Re: Can't define a preprocessor macro with Xcode 3.2.5
Re: Can't define a preprocessor macro with Xcode 3.2.5
- Subject: Re: Can't define a preprocessor macro with Xcode 3.2.5
- From: Ken Thomases <email@hidden>
- Date: Mon, 22 Nov 2010 12:26:59 -0600
On Nov 22, 2010, at 11:55 AM, Michael Crawford wrote:
> I'm trying to define the following for my build configuration:
>
> #define ANALYZER_TRACK_LIMIT 1
>
> I'm using the project info dialog to define this using the Preprocessor Macros option thus:
>
> http://dl.dropbox.com/u/4920112/Screen shot 2010-11-22 at 11.13.53 AM.PNG
>
> In my code I'm using logic like this:
>
> #ifdef ANALYZER_TRACK_LIMIT
> { some code I only want defined for certain builds }
> #endif
>
> I've also tried #if defined(x) and #if. Unless I put the define into one of my header files, the compiler doesn't seem to register it. Looking at the build output, I could not find any evidence that the macro was defined, either. There, the only macro that is consistently defined is -DDEBUG=1
>
> What am I missing here?
The Preprocessor Macros build setting is probably also set at the target level and doesn't reference $(inherited) or $(GCC_PREPROCESSOR_DEFINITIONS). Therefore, the target-level setting replaces the project-level setting.
Either arrange for the project-level to be preserved in the target-level setting, remove the target-level setting (if it's not needed), or set ANALYZER_TRACK_LIMIT at the target level (if it makes sense for it to be there).
Regards,
Ken
_______________________________________________
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