Main Content

Defines

Macro definitions to appear on compile line as -D directives

Model Configuration Pane: Simulation Target

Description

The Defines parameter specifies preprocessor macro definitions to be added to the compiler command line.

Settings

none (default)

Enter a list of macro definitions for the compiler command line. Specify the parameters with a space-separated list of macro definitions. If a makefile is generated, these macro definitions are added to the compiler command line in the makefile. The list can include simple definitions (for example, -DDEF1), definitions with a value (for example, -DDEF2=1), and definitions with a space in the value (for example, -DDEF3="my value"). Definitions can omit the -D (for example, -DFOO=1 and FOO=1 are equivalent). If the toolchain uses a different flag for definitions, the code generator overrides the -D and uses the appropriate flag for the toolchain.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precaution

No recommendation

Programmatic Use

Parameter: SimUserDefines
Type: character vector
Value: preprocessor macro definition
Default: none

Version History

Introduced in R2020b