A variable in a configuration file is an identifier that represents a value. Identifiers in configuration files must conform to the C++ rules for valid identifiers.
The types of variables, what they contain, and how their types and values are set, are listed below:
| Type | Contains | Set by |
|---|---|---|
| local variable | string, numeric, or string list data | = (assign) directive |
| option group | a list of options | option directive |
| source group | a list of source file names | group directive |
The type of a variable is set on its first appearance in the configuration file and cannot be changed. Here are examples of directives that introduce variables:
| Variable Type | Example Directive |
|---|---|
| local variable | color = "green" |
| options group | option pentium = gen(arch, "pentium"), opt(tune, "pentium") |
| source group | group mysources = "a.cpp", "b.cpp", "c.cpp" |
The value of local variables can be changed by assignments as often as required. The value of an options group or source group variables are defined by option or group directives, and can be assigned only once. To assign an empty string to a string variable, use the keyword null.
The scope of a variable is the range of the configuration file in which it can be used. After it is defined, a variable is accessible until the end of the configuration file. The perform directive can be used to limit the scope of variables. You must not refer to a variable before it is defined, or when it is made inaccessible by the perform directive.
![]()
Configuration Files
How Configuration Files Are
Processed
![]()
Configuration File Directives
Data Elements in Configuration Files
Environment Variables in Configuration
Files
Build Options
