Build Configuration Symbols

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Build Configuration Symbols

Jump to solution
2,869 Views
Mike_d
Contributor IV

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

 

2939_2939.bmpPaths and Symbols.bmp

Labels (1)
1 Solution
1,765 Views
CrasyCat
Specialist III

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.

  • Select Windows > Preferences. The Preferences dialog is opened.
  • Switch to C/C++ > Indexer page.
  • Check Use active build configuration radio button
  • Click on Apply and then OK to close the Preference Dialog.

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

View solution in original post

5 Replies
1,765 Views
mauriziostefane
Contributor II

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


0 Kudos
1,766 Views
CrasyCat
Specialist III

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.

  • Select Windows > Preferences. The Preferences dialog is opened.
  • Switch to C/C++ > Indexer page.
  • Check Use active build configuration radio button
  • Click on Apply and then OK to close the Preference Dialog.

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

1,765 Views
Richard2
Contributor III

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.

0 Kudos
1,765 Views
Richard2
Contributor III

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.

1,765 Views
Mike_d
Contributor IV

Thank you Catherine, that got it working.   For the record, my target is a Kinetis MCU.

Regards,

-Mike

0 Kudos