• 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: PPC and x86 target but build only one version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PPC and x86 target but build only one version


  • Subject: Re: PPC and x86 target but build only one version
  • From: tyler <email@hidden>
  • Date: Sat, 25 Feb 2006 22:04:42 -0800

We 'solved' this recently by using nested .xconfig files.

Each project and subproject gets their ARCHS value from the primary .xconfig file and it is set to be "ppc i386" in this file in order build universal binaries. That lets our automated build system build universal binaries and clean gets from source code control to a new folder always build universal. Then we include a second sub .xconfig file (which is not saved to source code control) in the primary one and have it define ARCHS as "$(NATIVE_ARCH)".


So, in the primary .xconfig file we have the following (along with whatever else you have there)



// Includes a local configuration file which can be used to override any of the
// above settings or to make any other settings changes local to your machine.
// For instance, you might want to set ARCHS = $(NATIVE_ARCH) just to build code
// for the machine you're building on.
// Xcode doesn't barf if the local.xcconfig file is missing.


#include "local.xcconfig"


local.xcconfig is NOT saved to source code control (so as to keep the automated clean get build system building universal).


The key here is that Xcode doesn't barf if the include file is missing - if any apple engineers are reading this, please make sure this "feature" doesn't get "fixed" :-)

One caveat - xcode only reads these config files at certain times so if you change them or rename the local.xcconfig file (to hide it and build a universal build) you have to close all the projects and re- open the main project to get it to reread the xconfig files.

Make sure you are not overriding the ARCHS setting in your targets or projects, obviously.


This works great. We each have a local.xcconfig on our machine in the build directory that can use to set the build to Native or Universal simply by renaming the local.xcconfig file and closing and opening the project(s), the automated build system always builds the full universal (since we didn't check in the local.xcconfig).


I can't take credit for this "fix". Steven Russell of buzzardsoft figured it out and shared it with our team.

luck,
tyler


On Feb 16, 2006, at 9:41 AM, James Larcombe wrote:

Daniel Jalkut wrote:

Oliver - in your debug build configuration, set the architectures value to "$(NATIVE_ARCH)"

The problem Olivier may find with this is that you still need your deployed builds to build on both architectures, ie. with ARCHS set to "ppc i386". In theory you should be get xcodebuild to do this (when you build your final deployable application) with the flag

'ARCHS ppc i386'

but this is another thing that doesn't seem to work properly for
subprojects (I forgot this one in my earlier post!). The subproject
files are compiled for both architectures, but the final libraries
are only linked for the native architecture, and thus when the top-
level application is built (as a Universal Binary), link errors
occur.

The best workaround we've found is to set ARCHS to "ppc i386" in
the .xcconfig configuration file on which all our projects' Release
configurations are based, and have NATIVE_ARCH in the .xcconfig
file for the Debug configurations. This works fine, but means that
you can't build the Release configuaration for a single architecture
on your own machine without modifying the project settings. This
isn't a big deal but is the sort of thing you always forget to do on
those fairly rare occasions when you need to track down a release-
build-only problem on your development machine.

Of course this also relies on all your subprojects using the same
underlying .xcconfig files, but these are so useful that I imagine
most people are already doing this.

James.
_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: PPC and x86 target but build only one version
      • From: Chris Espinosa <email@hidden>
References: 
 >PPC and x86 target but build only one version (From: Olivier Tristan <email@hidden>)
 >Re: PPC and x86 target but build only one version (From: Daniel Jalkut <email@hidden>)
 >Re: PPC and x86 target but build only one version (From: "James Larcombe" <email@hidden>)

  • Prev by Date: Re: Jump to Definitions
  • Next by Date: Re: [ANN] Step into Xcode
  • Previous by thread: Re: PPC and x86 target but build only one version
  • Next by thread: Re: PPC and x86 target but build only one version
  • Index(es):
    • Date
    • Thread