Re: #ifdef/build style question
Re: #ifdef/build style question
- Subject: Re: #ifdef/build style question
- From: patrick <email@hidden>
- Date: Thu, 6 Jan 2005 12:39:22 -0800
Actually, I got it to work with the Preprocessor Macros settings of
the Development Build Style. I just added DEBUG_ON=1, and it worked
great. The only annoying thing is that Xcode doesn't seem very smart
when you switch from one build style to another, and you seem to have
to do a Clean before a Build.
Thanks to everyone else who responded!
Patrick
On Thu, 6 Jan 2005 12:16:05 -0800, Scott Stevenson
<email@hidden> wrote:
>
> On Jan 6, 2005, at 10:26 AM, patrick wrote:
>
> > I'd like to have debug code in my application like:
> >
> > #ifdef DEBUG_ON
> > NSLog(@"This is a debug message");
> > #endif
> >
> > And DEBUG_ON would be defined in my Development build style. I've
> > added such a setting into the build style, but it would appear that
> > this is not the same as if I were using "make -DDEBUG_ON ...". Is
> > there a way to reference these settings in the build styles to control
> > what gets compiled in?
>
> I think your best bet is:
>
> Development Build Style
>
> Other C Flags: ${OTHER_CFLAGS} -DDEBUG_ON=1
>
> Your Target:
>
> Other C Flags: -DSOMETHING_TARGET_SPECIFIC=1
>
> I find the UI a bit unclear in that the Build Style and Target seem to
> override each other for "Other C Flags" (as strange as that sounds).
> This is probably either a cosmetic or documentation bug. The only
> solution I've found is the above.
>
> I originally tried the "Preprocessor Defines" build setting but I don't
> think it worked as I expected.
>
> - Scott
>
> --
> http://treehouseideas.com/
> http://theocacao.com/ [blog]
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden