开发者

Preprocessor Macros ignored in XCode's project settings, but not target settings

开发者 https://www.devze.com 2023-03-30 11:43 出处:网络
When I add a Preprocessor Macro in XCode 4 to one of my targets, it is used and conditional compilation occurs as I exp开发者_StackOverflow中文版ect it to.

When I add a Preprocessor Macro in XCode 4 to one of my targets, it is used and conditional compilation occurs as I exp开发者_StackOverflow中文版ect it to.

However, if I move that setting to the project level and out of one of my targets the preprocessor macro apparently is ignored and not used at all.

I verified that the macro is defined at all if I put it in the project's build setting through logging that is only compiled in when that macro is enabled.

How can that be?

System: OS X Lion, XCode 4.1 build 4B110, building for iOS 4.3.5, using the LLVM compiler, not GCC.


Have you completely deleted the build setting at the target level (not just blanked it)? If not, the target setting will completely override the project one. (You can avoid this by using $(inherited) in the target-level build setting.)

Xcode 4 makes it easy to see this type of problem: in the target’s Build Settings view, select “Levels” (instead of “Combined”) in the filter bar.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号