Add preprocessor macro to a target in xcode 6
66,760
Solution 1
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.
Solution 2
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.
Author by
user1051307
Updated on July 09, 2022Comments
-
user1051307 almost 2 years
Probably this is pretty simple, but I can't find a way to define a preprocessor macro for a target in Xcode 6.
-
user1051307 over 9 yearsThank you JoeFryer!!! ...you saved my day! I couldn't find it because I had the 'Basic' tab selected! ...stupid mistake of mine!
-
JoeFryer over 9 years@user1051307 don't forget to mark the answer as correct (if it is correct)
-
thst almost 9 yearsAnd 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> -
John M almost 9 yearsIf 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.
-
JoeFryer almost 9 years
$(inherited)
means that the settings are inherited from the project level to the target level. This probably isn't what you want, so yes, in your case, you could add it twice. -
Elise van Looij over 8 years@JohnM, if you enter a value on a line without expanding it, the value is applied to all underlying options, i.e. debug and release. If you want the value to apply to one option, expand the option list and set the individual values.
-
Nick N over 4 yearsFor a related swift migration use the following: stackoverflow.com/questions/38813906/…