Multiple build configurations

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

Multiple build configurations

跳至解决方案
1,476 次查看
dsherman
Contributor III

If I have sources which will build mutiple targets using different preprocessor defines which I've configured in the project settings, is there a nice way of either:

 

-Making multiple projects that use the same source files and project directory but have different settings

-or-

-Automating different builds through batch files that can provide the different combinations of #defines

 

I have source files that have dozens of possible build configurations, and it's a little tedious to have to edit the project settings to build each one.  I found that the preprocessor settings are stored in .cproject, but I can't tell what calls out that file.

标签 (1)
0 项奖励
回复
1 解答
1,107 次查看
Rick_Li
NXP Employee
NXP Employee

Hi David Sherman,

in KDS IDE, you can do that by creating different configurations.

the way is as below:

1) launch your project in KDS, right click the project name to launch Properties, then, extend "C/C++ Build" and click "Environment"

2) in the right panel, click "Manage Configurations..." button to add a new configuration by click "New..." button in the launched window.

3) then you have more than one configurations, select one of the configuration.

4) click "Settings" which is also under "C/C++ build" of Properties of your project, then, in right panel, click "Preprocessor" under "Cross ARM C Compiler", add defined symbols (Macros)

5) then, you will have multiple targets by selecting different Macros.

Hope it helps!

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,107 次查看
dsherman
Contributor III

Almost there!  As a test, I got it to build another configuration.  In the debug configuration, if I try to substitute ${config_name} in the path to the executable, I get an error saying:

Project name should be specified as variable argument for ${config_name} variable

Short of having to specify the path to the executable for each target, any idea why including the config_name variable doesn't work?

0 项奖励
回复
1,108 次查看
Rick_Li
NXP Employee
NXP Employee

Hi David Sherman,

in KDS IDE, you can do that by creating different configurations.

the way is as below:

1) launch your project in KDS, right click the project name to launch Properties, then, extend "C/C++ Build" and click "Environment"

2) in the right panel, click "Manage Configurations..." button to add a new configuration by click "New..." button in the launched window.

3) then you have more than one configurations, select one of the configuration.

4) click "Settings" which is also under "C/C++ build" of Properties of your project, then, in right panel, click "Preprocessor" under "Cross ARM C Compiler", add defined symbols (Macros)

5) then, you will have multiple targets by selecting different Macros.

Hope it helps!

0 项奖励
回复
1,107 次查看
dsherman
Contributor III

Yes, thank you!  That works perfectly!  Guess I didn't realize that new configurations can be added and have separate settings.  :smileyhappy:

0 项奖励
回复