Common preprocessor macros for all configurations

2019-04-10 19:11发布

I usually have four configurations per target (Debug, Release, Distribution, Ad Hoc) for my Apps.

Is there a way to add a common macro for all 4 of them, while not destroying the macros that I have set so far (you see "multiple values" in the editor).

Thanks in advance, Obiwahn

3条回答
Juvenile、少年°
2楼-- · 2019-04-10 19:30

Define the macro in the prefix header file (will be included in all source files).

查看更多
唯我独甜
3楼-- · 2019-04-10 19:39

You could have all of your targets use the same .xcconfig file; see apple documentation under the heading "Build Configuration Files". Note that even though the screenshots are out of date, the material seems to be accurate.

查看更多
放荡不羁爱自由
4楼-- · 2019-04-10 19:46

Another way do do this, which might work better for certain cases, is to use the $(inherited) macro to include the settings from the parent context. This works well with the way Xcode 4 lets you see the settings cascade.

查看更多
登录 后发表回答