Preprocessor Macros ignored in XCode's project settings, but not target settings
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.
精彩评论