There are a few possible options, one option, my preference, would be to define a symbol, not an environment variable:
1. Right click the current project folder/directory and select
Properties.
2. While in the properties dialog window, expand
C/C++ General menu on the left side of the dialog window, then select
Paths and Symbols.
3. Click
Add on the far right, enter
Name, and
Value if required, check both the
Add to all configurations and
Add to all languages options.
4. Click
Apply you should then see the following message box:
5. Click
Yes to rebuild the project with the newly defined symbol, you should see the symbol defined in the resulting compiler messages:
Another option is to define a compiler flag, -D flag option, the drawbacks to this method. the flag must be defined for all languages used, C and C++, and any future changes require the compiler flag be edited for any language for which it is defined.
1. Right click the current project folder/directory and select
Properties.
2. While in the properties dialog window, expand
C/C++ Build menu on the left side of the dialog window, then select
GCC C++ Compiler and
Miscellaneous.
3. Enter the required -D compiler flag, with the symbol name, and value if required, as below, in the Other flags text box on the right:
4. Repeat the above steps for the
GCC C Compiler option and its associated
Miscellaneous.
4. Then clean and rebuild the project, the compiler flag should be visible in the compiler messages:
BigDog