coder.ExternalDependency.getDescriptiveName

Class: coder.ExternalDependency
Package: coder

Return descriptive name for external dependency

Syntax

extname = coder.ExternalDependency.getDescriptiveName(bldcfg)

Description

extname = coder.ExternalDependency.getDescriptiveName(bldcfg) returns the name that you want to associate with an external dependency. The code generator uses the external dependency name for error messages.

Input Arguments

bldcfg

coder.BuildConfig object. Use coder.BuildConfig methods to get information about the build context

You can use this information when you want to return different names based on the build context.

Output Arguments

extname

External dependency name returned as a character vector.

Definitions

external dependency

External code interface represented by a class derived from a coder.ExternalDependency class. The external code can be a library, object files, or C/C++ source.

build context

Information used by the build process including:

  • Target language

  • Code generation target

  • Target hardware

  • Build toolchain

Examples

expand all

Define a method that always returns the same name.

function myextname = getDescriptiveName(~)
   myextname = 'MyLibrary' 
end

Define a method that uses the build context to determine the name.

function myextname = getDescriptiveName(context)
    if context.isMatlabHostTarget()
        myextname = 'MyLibary_MatlabHost';
    else
        myextname = 'MyLibrary_Local';
    end
end
Was this topic helpful?