Re: Passing command-line define's to projects/targets with xcodebuild
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