Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode Preprocessor Macro for Configuration?

I want my XCode Objective-C project to be able to detect which configuration it is being built with. How can I achieve this?

like image 876
JP Richardson Avatar asked Sep 28 '09 03:09

JP Richardson


1 Answers

You can have per-configuration macro definitions. Open up your project settings, select your configuration from the Configuration drop-down menu, and go to Preprocessor Macros. For Debug, I recommend defining the macro _DEBUG, and for release I recommend defining _RELEASE, as these are the typical ones which are used. These are passed on to the compiler as -D options, e.g. -D_DEBUG.

You can also put -D options directly into the Other C Flags setting.

like image 168
Adam Rosenfield Avatar answered Sep 28 '22 07:09

Adam Rosenfield