Probably this is pretty simple, but I can't find a way to define a preprocessor macro for a target in Xcode 6.
2 Answers
I've done a screenshot to show where it is in Xcode, because it's easier :)
- Select project file
- Select the target you want
- Go to Build Settings
- Search for 'preprocessor'
- Add your preprocessor macro either for Debug, Release, or both.
-
3Thank you JoeFryer!!! ...you saved my day! I couldn't find it because I had the 'Basic' tab selected! ...stupid mistake of mine! Nov 14, 2014 at 11:57
-
@user1051307 don't forget to mark the answer as correct (if it is correct)– JoeFryerNov 14, 2014 at 15:44
-
4And if you happen to search your (insert important bodypart here) off for this setting make sure, the filter is set to
ALL
settings, not justBASIC
... <facepalm>– thstJul 20, 2015 at 16:04 -
If I want for both debug and release I enter it twice? No place to put shared ones? When looking at the situation before I edited, I saw $(inheritedxxx) -- can't remember the exact spelling. Seemed like there was some support for something a bit better than having to repeat myself. But couldn't figure it out.– John MJul 27, 2015 at 16:55
-
1For a related swift migration use the following: stackoverflow.com/questions/38813906/…– Nick NJan 12, 2020 at 3:43
In Xcode 9 you have to add a preprocessor macros to Project, not Target. Also don't forget to add "D" as the firs letter. For example, "DDebug", then it works.