• 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: OS/Xcode conditional build setting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS/Xcode conditional build setting


  • Subject: Re: OS/Xcode conditional build setting
  • From: Dennis Munsie <email@hidden>
  • Date: Mon, 7 Dec 2009 14:16:38 -0500

This is a neat solution to the problem, but what happens when Xcode 3.3 (or 4.0, or whatever) comes out?  Is there a way to say GCC_VERSION = 4.2 on Xcode 3.1 and earlier while it's com.apple.compilers.llvmgcc42 on anything later?

dennis

On Mon, Dec 7, 2009 at 12:57 PM, Chris Espinosa <email@hidden> wrote:
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



--
dennis
 _______________________________________________
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: 
 >OS/Xcode conditional build setting (From: Eric Gorr <email@hidden>)
 >Re: OS/Xcode conditional build setting (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: OS/Xcode conditional build setting
  • Next by Date: MLTEShowcase
  • Previous by thread: Re: OS/Xcode conditional build setting
  • Next by thread: MLTEShowcase
  • Index(es):
    • Date
    • Thread