• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: xcodebuild and build settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xcodebuild and build settings


  • Subject: Re: xcodebuild and build settings
  • From: Scott Tooker <email@hidden>
  • Date: Wed, 28 Nov 2007 10:07:30 -0800

And when you don't have the build setting override in place you get FOO == 1?

I just tried this with a small test project (a new Cocoa Application) and the following works for me on Xcode 3:

xcodebuild GCC_PREPROCESSOR_DEFINITIONS='$(value) BAR=1'

Scott

On Nov 28, 2007, at 9:42 AM, email@hidden wrote:

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
 
On Nov 28, 2007, at 3:41 AM, email@hidden wrote:
> $(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
> On Nov 27, 2007, at 6:18 PM, email@hidden wrote:
>> 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

References: 
 >Re: xcodebuild and build settings (From: email@hidden)

  • Prev by Date: Re: Syntax highlighting for scripting languages
  • Next by Date: Re: pthread_cond_init$UNIX2003 not found on 10.4
  • Previous by thread: Re: xcodebuild and build settings
  • Next by thread: Re: xcodebuild and build settings
  • Index(es):
    • Date
    • Thread