addDefines

Add preprocessor macro definitions to model's build information

Syntax

addDefines(buildinfo, macrodefs, groups)

groups is optional.

Arguments

buildinfo

Build information returned by RTW.BuildInfo.

macrodefs

A character array or cell array of character arrays that specifies the preprocessor macro definitions to be added to the object. The function adds each definition to the end of a compiler option vector. If you specify multiple definitions within a single character array, for example '-DRT -DDEBUG', the function adds the string to the vector as a single element. For example, if you add '-DPROTO -DDEBUG' and then '-DPRODUCTION', the vector consists of two elements, as shown below.

'-DPROTO -DDEBUG'    '-DPRODUCTION'
groups (optional)

A character array or cell array of character arrays that groups specified definitions. You can use groups to

You can apply

To...Specify groups as a...
Apply one group name to all macro definitionsCharacter array. To specify macro definitions to be used in the standard Real-Time Workshop® makefile build process, specify the character array 'OPTS' or 'OPT_OPTS'.
Apply different group names to macro definitionsCell array of character arrays such that the number of group names matches the number elements you specify for macrodefs. Available for nonmakefile build environments only.

Description

The addDefines function adds specified preprocessor macro definitions to the model's build information. The Real-Time Workshop software stores the definitions in a vector. The function adds definitions to the end of the vector based on the order in which you specify them.

In addition to the required buildinfo and macrodefs arguments, you can use an optional groups argument to group your options.

Examples

See Also

addCompileFlags, addLinkFlags
Programming a Post Code Generation Command

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS