Main Content

coder.ExternalDependency.isSupportedContext

Class: coder.ExternalDependency
Package: coder

Determine if build context supports external dependency

Syntax

tf = coder.ExternalDependency.isSupportedContext(bldcfg)

Description

tf = coder.ExternalDependency.isSupportedContext(bldcfg) returns true (1) if you can use the external dependency in the current build context . You must provide this method in the class definition for a class that derives from coder.ExternalDependency.

If you cannot use the external dependency in the current build context, display an error message and stop code generation. The error message must describe why you cannot use the external dependency in this build context. If the method returns false (0), the code generator uses a default error message. The default error message uses the name returned by the getDescriptiveName method of the coder.ExternalDependency class.

Use coder.BuildConfig methods to determine if you can use the external dependency in the current build context.

Input Arguments

bldcfg

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

Output Arguments

tf

Value is true (1) if the build context supports the external dependency.

Examples

expand all

This method returns true(1) if the code generation target is a MATLAB® host target. Otherwise, the method reports an error and stops code generation.

Write isSupportedContext method.

function tf = isSupportedContext(ctx)
    if  ctx.isMatlabHostTarget()
        tf = true;
    else
        error('adder library not available for this target');
    end
end

More About

expand all