Hi,
I'm having issues getting a symbol to be tied to a build configuration. I want to define DEBUG in my debug build configuration and not in my release build configuration. After creating a bareboard project using the wizard it seems that symbols only work in the RAM configuration and they apply to all configurations even though you see nothing defined.
Has anybody gotten around this problem?
Thanks,
-Mike
Solved! Go to Solution.
Hello
Not sure I understand the issue here.
Is the problem that you did define a macro DEBUG in your RAM build configuration only and when switching to the other configuration the conditional code displays code depending on macro DEBUG as active?
If this is the problem, this can be adjusted through a preference settings.
The display of conditional code should now match the macros defined for current configuration.
If this was not the problem, can you please be a little bit more specific.
Which controller are you targeting (HC08, ColdFire, Kinetis, ...)?
What is the problem exactly?
CrasyCat
Hello Michael,
in CW 10.2 if you need a preprocessor symbol like '#define DEBUG 1' you have to right-click your Debug issue and set 'Properties', and go to C/C++ Build -> Settings -> Tool Settings -> ... Compiler -> Language Settings
In this screen there is the 'Other flags" box: write in it "-define_DEBUG=1".
Regards
Hello
Not sure I understand the issue here.
Is the problem that you did define a macro DEBUG in your RAM build configuration only and when switching to the other configuration the conditional code displays code depending on macro DEBUG as active?
If this is the problem, this can be adjusted through a preference settings.
The display of conditional code should now match the macros defined for current configuration.
If this was not the problem, can you please be a little bit more specific.
Which controller are you targeting (HC08, ColdFire, Kinetis, ...)?
What is the problem exactly?
CrasyCat
I've now tried this in CodeWarrior 10.6, build id 140329 and it doesn't work at all.
Code highlighting of #IFDEF blocks does not follow the currently-chosen configuration, regardless of this Indexer setting.
I have two Build Configurations, one for each target board.
Each configuration has a define set in Project Properties > C/C++ General > Paths and Symbols > Symbols
They build correctly (checked with #warning), however the #ifdef highlighting is always whichever building configuration happens to be the one at the top of the list of configurations.
For the record, this is a godawful default value.
I just wasted half a day trying to figure out why the #ifdef highlighting was wrong the moment I had more than one configuration, when I knew for certain the define was there due to #warning being right during compilation.
Thank you Catherine, that got it working. For the record, my target is a Kinetis MCU.
Regards,
-Mike