xcode seems to ignore preprocesser flags
I've seen all the posts about setting preprocessor flags via the "Preprocessor Macros" setting. For some reason, Xcode seems to ignore my settings.
I'm building an Xcode project that was created via CMake. Inside the Dependencies.cmake file, there are a few definitions added. 开发者_JAVA百科For example:
add_definitions(-DUSE_POCO)
add_definitions(-DPOCO_STATIC)
When I look at my Xcode project and Edit Target Info, I see them under "Preprocessor Macros". When I build the project, I see them defined in the command line used. Now if I try to change them, my changes have no effect. I've tried changing POCO_STATIC to POCO_STATIC1 under "Preprocessor Macros", but that gets ignored.
I have the following code to test:
#ifdef POCO_STATIC1
adsjfklasjdf
#endif
If I remove the 1, then it won't compile. If I put back the 1, everything is back to normal. So that means, my changes aren't taking any effect.
I've tried futzing with "Preprocessor Macros" at the Project level (it's empty), but that does nothing either. I've also looked at "Other C++ Flags" to no avail. Basically it seems that these settings are nothing being passed to the compiler (GCC 4.2).
Any ideas? Thanks.
It sounds like something else is getting in the way. Are you running the project as a pure XCode project or is cmake still involved?
精彩评论