[TIP] Active build configuration macros
[TIP] Active build configuration macros
- Subject: [TIP] Active build configuration macros
- From: Chris Espinosa <email@hidden>
- Date: Sun, 21 Jan 2007 14:08:59 -0800
On Jan 21, 2007, at 12:49 PM, Alexander von Below wrote: You can define such macros yourself, either in the project or the target build settings.
In your Development configuration, go to "other C Flags" and enter
-D_DEVELOPMENT_
Alex
Am 21.01.2007 um 21:46 schrieb Nick Briggs:
Hi
Is there a macro to enable me to conditionally compile code based on the 'active build configuration'? Im looking for something like:
#if __DEVELOPMENT__
// some error checking code
#endif
The better place to do this is in the Preprocessor Macros build setting (better yet, in Preprocessor Macros Not Used In Precompiled Headers).
You can set this up once in a general way by using an .xcconfig file:
GCC_PREPROCESSOR_DEFINITIONS_NOT_ USED_IN_PRECOMPS = CONFIGURATION_$(CONFIGURATION)
Then any target configuraition that is Based On this .xcconfig file will automatically have a macro defined for that target, such as
CONFIGURATION_Debug
or
CONFIGURATION_Release
The reason to use the "Not Used in Precomps" setting is so that the difference in preprocessor definitions doesn't cause your project to gratuitously double the number of different precompiled header files it builds, on the chance that your headers care about this macro.
Chris |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden