Build configurations - defining a variable

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

Build configurations - defining a variable

Jump to solution
549 Views
mikemorris
Contributor II

Hi,

Fairly new to CW and have encountered a problem that I am looking for some support on.

 

I have a project with 2 build configurations; one I use for release and one for debugging.

I want to be able to set a variable to a particular value for each configuration.

 

eg. uc_DebugMode == 1 when running the debug config.

 

Is there a way to do this in CW10.6 using a Kinetis product?

 

I have tried to use the defined macros in arm compiler -> input but get the following when compiling:

Specified file 'uc_DebugMode' not found.

 

Any ideas?

Thanks,

 

Mike

Labels (1)
0 Kudos
1 Solution
448 Views
mikemorris
Contributor II

Hi Carlos,

Thanks for the response.

I couldn't figure out how to do this however I managed to get it working by going to properties -> c/c++ general --> paths and symbols.

In here I set a define to a value for each build configuration.


Thanks again,

Mike

View solution in original post

0 Kudos
2 Replies
449 Views
mikemorris
Contributor II

Hi Carlos,

Thanks for the response.

I couldn't figure out how to do this however I managed to get it working by going to properties -> c/c++ general --> paths and symbols.

In here I set a define to a value for each build configuration.


Thanks again,

Mike

0 Kudos
448 Views
Carlos_Musich
NXP Employee
NXP Employee

Hello mikemorris,

Each build configuration has its own project settings (menu Project > Properties > C/C++ Build > Settings), so you can change the settings of one configuration and the other will keep the same.

You can define independent macros for each configuration in menu Project > Properties > C/C++ Build > Settings > Compiler > Preprocessor

If you have any question please let me know.


Best regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos