I cannot get this macro to compile the correct code.
Here is the code:
Here are the build settings (I'm doing a Release build):
Note that the GCC documentation says -Dname will define as 1, so I omitted the "=1" for Release:
Here is the compile log showing that the definition (in yellow) was passed along on the command line:
Here is my output log showing that the code is compiled as if ADD_CAMERA_FEATURE is not defined:
If I put #define ADD_CAMERA_FEATURE 1 in the source, the #ifdef works as expected, but I also get a warning that I am redefining an existing macro. So XCode knows that the macro should exist from the build scheme settings, but still does not include the #ifdef branch of code.
Other details:
- XCode 5.1
- OS X 10.9.2
- iOS 7.1
My objective here is to have a target for building iOS 7 version of the app and a target for building a pre-iOS 7 version of the app, both from the same source. I have to support older devices that cannot be upgraded to iOS 7 for a while longer. Perhaps there is a better way to go about this. Any suggestions about how to accomplish this would be appreciated.