• 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: Passing command-line define's to projects/targets with xcodebuild
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing command-line define's to projects/targets with xcodebuild


  • Subject: Re: Passing command-line define's to projects/targets with xcodebuild
  • From: Philip Prindeville <email@hidden>
  • Date: Tue, 26 Feb 2013 13:19:12 -0700

On Feb 21, 2013, at 3:40 PM, Philip Prindeville <email@hidden> wrote:

> Hi.
>
> I'm new to the list so bear with me please.
>
> I'm trying to do some automated builds for nightly regression testing, etc. using xcodebuild on MacOS 10.8.2 and Xcode 4.5.1.
>
> Part of my requirement is to build projects with addition #define's passed in to clang via -D on the command line.
>
> For C++ projects I've been using:
>
> % xcodebuild -target … OTHER_CPLUSPLUSFLAGS="-Dname1=value1 …"
>
> and this has been working well, but for Objective-C projects this symbol isn't used… there doesn't seem to be one specific to Objective-C or Objective-C++, and I don't want to clobber the project's values for CFLAGS (though augmenting them would work, but I've not found a description of how $(inherited) is used or what its semantics are) by using OTHER_CFLAGS.
>
> Is there a good primer on command-line use of xcodebuild and build automation?
>
> Thanks,
>
> -Philip


Figured out that I can do:

% xcodebuild -target ... OTHER_CFLAGS="\$(OTHER_CFLAGS) -Dname1=value1 …"

and that works, but it still means that in a product with several sub-projects, you're forced to pass the same OTHER_CFLAGS to both C projects and Objective-C projects alike.

That said, a separate variable OTHER_OBJECTIVECFLAGS would have been welcome.

-Philip


 _______________________________________________
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: 
 >Passing command-line define's to projects/targets with xcodebuild (From: Philip Prindeville <email@hidden>)

  • Prev by Date: Re: How to fix the dreaded "No Editor" in Xcode 4.6 w/ SVN
  • Next by Date: Binding CD ordered sets to NSArrayController?
  • Previous by thread: Passing command-line define's to projects/targets with xcodebuild
  • Next by thread: truncated stack on device with lldb in Xcode 4.6
  • Index(es):
    • Date
    • Thread