Build configurations - defining a variable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Build configurations - defining a variable

ソリューションへジャンプ
836件の閲覧回数
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 解決策
735件の閲覧回数
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 返答(返信)
736件の閲覧回数
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 件の賞賛
返信
735件の閲覧回数
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 件の賞賛
返信