Re: OS/Xcode conditional build setting
Re: OS/Xcode conditional build setting
- Subject: Re: OS/Xcode conditional build setting
- From: Chris Espinosa <email@hidden>
- Date: Mon, 7 Dec 2009 09:57:58 -0800
On Dec 7, 2009, at 8:56 AM, Eric Gorr wrote:
> I have an odd case where I need to have the value of GCC_VERSION based on either the OS being used or the version of Xcode.
>
> It looks like the current system only allow conditional build settings to be based on arch, sdk, or variant.
>
> Basically, if building with Xcode 3.1, I want gcc4.2. But, if building with Xcode 3.2, I want llvm-gcc4.2.
>
> The reason is that it appears that llvm under 3.1 generates warnings that aren't generated in 3.2. And, since I am treating warning a as errors, I can't build with 3.1 which is still needed.
>
> An odd case I know, but a solution which does not involve not using 3.1 is needed.
Here's the classic way to do this.
1) Create a custom build setting GCC_VERSION_0310 = 4.2
2) Create a custom build setting GCC_VERSION_0320 = com.apple.compilers.llvmgcc42
3) Define GCC_VERSION to be $(GCC_VERSION_$(XCODE_VERSION_MINOR))
When XCODE_VERSION_MINOR is 0310, GCC_VERSION is set to 4.2; when it's 0320, it's set to com.apple.compilers.llvmgcc42.
This technique works for making any build setting conditional on any other setting with a known discrete set of values.
Chris _______________________________________________
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