getCompileFlags

Get compiler options from model build information

Description

example

options = getCompileFlags(buildinfo,includeGroups,excludeGroups) returns compiler 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.

Examples

collapse all

Get the compiler options stored in the build information myModelBuildInfo.

myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo,{'-Zi -Wall' '-O3'}, ...
   'OPTS');
compflags = getCompileFlags(myModelBuildInfo);
>> compflags

compflags = 

    '-Zi -Wall'    '-O3'

Get the compiler options stored with the group name Debug in the build information myModelBuildInfo.

myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo,{'-Zi -Wall' '-O3'}, ...
   {'Debug' 'MemOpt'});
compflags = getCompileFlags(myModelBuildInfo,'Debug');
>> compflags

compflags = 

    '-Zi -Wall'

Get the compiler options stored in the build information myModelBuildInfo, except those options with the group name Debug.

myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo,{'-Zi -Wall' '-O3'}, ...
   {'Debug' 'MemOpt'});
compflags = getCompileFlags(myModelBuildInfo,'','Debug');
>> compflags

compflags = 

    '-O3'

Input Arguments

collapse all

To use the includeGroups argument, view available groups by using myGroups = getGroups(buildInfo).

Example: ''

To use the excludeGroups argument, view available groups by using myGroups = getGroups(buildInfo).

Example: ''

Output Arguments

collapse all

Introduced in R2006a