Build configurations - defining a variable

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Build configurations - defining a variable

跳至解决方案
572 次查看
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

标签 (1)
0 项奖励
回复
1 解答
471 次查看
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 项奖励
回复
2 回复数
472 次查看
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 项奖励
回复
471 次查看
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 项奖励
回复