Re: OTHER_CFLAGS being silently ignored
Re: OTHER_CFLAGS being silently ignored
- Subject: Re: OTHER_CFLAGS being silently ignored
- From: Jeff Disher <email@hidden>
- Date: Wed, 11 Dec 2002 13:25:32 -0500
Take a look at the build styles. I have this same setup with
OTHER_CFLAGS being -DDEBUG and it works. I put it in the options for
my development build style and not in the deployment style so I have an
easy way to switch between them. Also, options specified in the build
style seem to over-write the ones used in the actual target settings
(for example, the default project template has -O0 in the development
build style which is used instead of your other optimization settings
when using that style).
Either put these options in the build style or make sure that your
build style isn't over-writing them.
Hope that helps,
Jeff.
On Wednesday, December 11, 2002, at 12:27 PM, Greg Hurrell wrote:
Has anyone else ever had a problem with the OTHER_CFLAGS field in
Project Builder's Expert build settings silently ignoring the > settings?
Specifically, I have a line like this in my OTHER_CFLAGS build
settings:
-DDEBUG
And then in my source code I have an #ifdef DEBUG block... the problem
is, I never get inside the #ifdef block.
I've done some experimentation and found out the following about the
weird behaviour:
1. It makes no difference whether the OTHER_CFLAGS field is preceded
by an "=" sign or a "+=" sign in the Project Builder expert settings
interface.
2. The WARNING_CFLAGS field is also having no effect -- I can put
anything in there and it makes no difference to the options that are
passed to the compiler.
3. By turning up the build log detail and looking at the output I can
see that the flags simply aren't being passed to the compiler at all.
4. If I insert a #define DEBUG into my code, then I can see a -DDEBUG
flag being passed to gcc in the build log! The debug code gets
compiled in.
5. If I clear the OTHER_CFLAGS field and leave the #define DEBUG
statement in the code, then I see no -DDEBUG flag being passed to gcc
in the build log, but the debug code still gets compiled in.
6. If I put -DDEBUG back into the OTHER_CFLAGS field and leave the
#define DEBUG statement in the code then not only does the debug code
get compiled in, but gcc warns me that I've got a redeclaration of the
DEBUG value (ie. it gets it passed it on the command line AND it reads
it from the source file...)
7. If I create a brand new test project and set -DDEBUG in the
OTHER_CFLAGS field, then it works as expected (the #ifdeg DEBUG test
works)
Any suggestions as to what could help me to fix this bizarre and
annoying behaviour? I've already wasted several hours trying to
trouble shoot it...
Cheers
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
Jeff Disher
President and Lead Developer of Spectral Class
Spectral Class: Shedding Light on Innovation
http://www.spectralclass.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.