Unfortunately it doesn't work.
The inherited value is not passed on to the compiler.
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
>> 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
>> >>