Re: xcodebuild and build settings
Re: xcodebuild and build settings
- Subject: Re: xcodebuild and build settings
- From: email@hidden
- Date: Wed, 28 Nov 2007 17:42:22 +0000
Unfortunately it doesn't work.
The inherited value is not passed on to the compiler.
In my code I have
#if FOO
printf("FOO == 1\n");
#else
printf("FOO == 0\n);
#endif
and a similar snippert for BAR.
I have FOO=1 in the Preprocessor Macros in the project build settings.
The command line is
xcodebuild GCC_PREPROCESSOR_DEFINITIONS="$(value) BAR=1"
Only -DBAR=1 is passed on to the compiler. Hence when I run the code,
the output is
FOO == 0
BAR == 1
Carsten Hansen
> $(value) is the same as $(inherited), it references the inherited
> value for that build setting. So you literally enter "$(value)" in the
> build setting to reference the previous level's value for that build
> setting.
> Scott
>> I changed to use GCC_PREPROCESSOR_DEFINITIONS.
>> However, I'm unsure what "value" is supposed to be.
>> If I use GCC_PREPROCESSOR_DEFINITIONS, it appears the
>> command interpreter expands it to nothing.
>> When I look at the output of xcodebuild, I only see -DXYZ=1.
>> The original GCC_PREPROCESSOR_DEFINITIONS
>> values (specified in the Project) are no longer
>> present.
>>
>> Carsten Hansen
>>
>> On Nov 26, 2007, at 8:43 AM,
email@hidden wrote:
>> > On Nov 23, 2007, at 10:47 AM,
email@hidden wrote:
>> >> I'm creating a Standard Tool, Command Line Utility.
>> >> Suppose in the Build settings for the Project I have:
>> >> Other C Flags $(inhe
rited)
-DFOO=1 -DBAR=0
>> >>
>> >> How can I append another symbol (-DXYZ=1) from the command line
>> when
>> >> using xcodebuild?
>> >> How can I modify the value of BAR to be 1 from the command line
>> when
>> >> using xcodebuild?
>> > The strict answer to your question is:
>> > xcodebuild OTHER_CFLAGS="$(value) -DXYZ=1"
>> > but the real answer is: don't use OTHER_CFLAGS for preprocessor
>> > macros, use "Preprocessor Macros" instead. For example,
>> > xcodebuild GCC_PREPROCESSOR_DEFINITIONS="$(value) XYZ=1"
>> > The man page for xcodebuild gives more details. One lesser known
>> fact
>> > is that you can also pass defaults in addition to build settings on
>> > the xcodebuild command line, for example:
>> > xcodebuild -PBXNumberOfParallelBuildSubtasks=
1
&
gt;> > Scott
>>
>> >>
>> >> Thanks,
>> >>
>> >> Carsten Hansen
>> >>
_______________________________________________
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