Preprocessor macros are ignored in the Xcode project settings, but not the target settings

When I add a preprocessor macro in Xcode 4 to one of my goals, it is used, and conditional compilation happens as I expect.

However, if I transfer this setting to the project level and from one of my goals, the preprocessor macro is apparently ignored and not used at all.

I checked that the macro is defined in general if I put it in the build configuration of the project through a log that only compiles when this macro is enabled.

How can it be?

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

+4
source share
1 answer

Have you completely removed the build setting at the target level (and not just lowered it)? If not, setting the goal will completely redefine the project. (This can be avoided by using $(inherited) in setting up the target level build.)

Xcode 4 makes it easy to see this type of problem: in the Assembly Options view, select Levels (instead of Combined) in the filter panel.

+5
source

Source: https://habr.com/ru/post/1368941/


All Articles