| Contents | Index |
addCompileFlags(buildinfo, options, groups)
groups is optional.
Build information returned by RTW.BuildInfo.
A character array or cell array of character arrays that specifies the compiler options to be added to the build information. The function adds each option to the end of a compiler option vector. If you specify multiple options within a single character array, for example '-Zi -Wall', the function adds the string to the vector as a single element. For example, if you add '-Zi -Wall' and then '-O3', the vector consists of two elements, as shown below.
'-Zi -Wall' '-O3'
A character array or cell array of character arrays that groups specified compiler options. You can use groups to
Document the use of specific compiler options
Retrieve or apply collections of compiler options
You can apply
A single group name to one or more compiler options
Multiple group names to collections of compiler options (available for nonmakefile build environments only)
| To... | Specify groups as a... |
|---|---|
| Apply one group name to all compiler options | Character array. |
| Apply different group names to compiler options | Cell array of character arrays such that the number of group names matches the number of elements you specify for options. |
Note
|
The addCompileFlags function adds specified compiler options to the model build information. Simulink Coder stores the compiler options in a vector. The function adds options to the end of the vector based on the order in which you specify them.
In addition to the required buildinfo and options arguments, you can use an optional groups argument to group your options.
Add the compiler option -O3 to build information myModelBuildInfo and place the option in the group OPTS.
myModelBuildInfo = RTW.BuildInfo; addCompileFlags(myModelBuildInfo, '-O3', 'OPTS');
Add the compiler options -Zi and -Wall to build information myModelBuildInfo and place the options in the group OPT_OPTS.
myModelBuildInfo = RTW.BuildInfo; addCompileFlags(myModelBuildInfo, '-Zi -Wall', 'OPT_OPTS');
For a nonmakefile build environment, add the compiler options -Zi, -Wall, and -O3 to build information myModelBuildInfo. Place the options -Zi and -Wall in the group Debug and the option -O3 in the group MemOpt.
myModelBuildInfo = RTW.BuildInfo;
addCompileFlags(myModelBuildInfo, {'-Zi -Wall' '-O3'}, ...
{'Debug' 'MemOpt'});addDefines | addLinkFlags | getCompileFlags

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |