Main Content

getLinkFlags

Get link options from build information

Description

options = getLinkFlags(buildinfo,includeGroups,excludeGroups) returns linker options from the build information.

The function requires the buildinfo argument. You can use optional includeGroups and excludeGroups arguments. These optional arguments let you include or exclude groups selectively from the compiler options returned by the function.

If you choose to specify excludeGroups and omit includeGroups, specify a null character vector ('') for includeGroups.

example

Examples

collapse all

Get the linker options from the build information, myBuildInfo.

myBuildInfo = RTW.BuildInfo;
addLinkFlags(myBuildInfo,{'-MD -Gy' '-T'},'OPTS');
linkflags = getLinkFlags(myBuildInfo);
>> linkflags

linkflags = 

    '-MD -Gy'    '-T'

Get the linker options with the group name Debug from the build information, myBuildInfo.

myBuildInfo = RTW.BuildInfo;
addLinkFlags(myBuildInfo,{'-MD -Gy' '-T'}, ...
   {'Debug' 'MemOpt'});
linkflags = getLinkFlags(myBuildInfo,{'Debug'});
>> linkflags

linkflags = 

    '-MD -Gy'

Get the linker options from the build information myBuildInfo, except those options with the group name Debug.

myBuildInfo = RTW.BuildInfo;
addLinkFlags(myBuildInfo,{'-MD -Gy' '-T'}, ...
   {'Debug' 'MemOpt'});
linkflags = getLinkFlags(myBuildInfo,'',{'Debug'});
>> linkflags

linkflags = 

    '-T'

Input Arguments

collapse all

RTW.BuildInfo object that contains information for compiling and linking generated code.

Group names of linker options to include in the return from the function, specified as a string or a cell array of character vectors. To view the group name of a linker option, access the Group property of the corresponding object.

Example: ''

Group names of linker options to exclude from the return from the function, specified as a string or a cell array of character vectors. To view the group name of a linker option, access the Group property of the corresponding object.

Example: ''

Output Arguments

collapse all

Linker options from the build information.

Version History

Introduced in R2006a