• 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
[FAQ] Per-processor type framework linking?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FAQ] Per-processor type framework linking?


  • Subject: [FAQ] Per-processor type framework linking?
  • From: Chris Espinosa <email@hidden>
  • Date: Mon, 4 Dec 2006 20:31:21 -0800

On Dec 4, 2006, at 5:22 PM, Blair M. Burtan wrote:

Is it possible to configure an Xcode project (not using command line or
other low tech method) to link in one set of frameworks for PPC and another
for i386 so that the UB app doesn't complain when it can't find the set
that's not pertinent for that processor?

Yes, but it isn't pretty.  This solution is for Xcode 2.3 and later:

1) Add all the frameworks, both PowerPC and Intel, to the target that you want to link with them.

2) Add a build property in the target with the name and value

EXCLUDED_SOURCE_FILE_NAMES   $(EXCLUDED_SOURCE_FILE_NAMES_$(CURRENT_ARCH))

3) Add a build property in the target with the name

EXCLUDED_SOURCE_FILE_NAMES_PPC   

Its value should be a space-separated list of the names of the Intel-only frameworks (in the form MyIntelFramework.framework)

4) Add a build property in the target with the name

EXCLUDED_SOURCE_FILE_NAMES_i386   

Its value should be a space-separated list of the names of the PowerPC-only frameworks.


When you build the target, Xcode iterates with $(CURRENT_ARCH) set in turn to PPC and i386. This will cause the value of EXCLUDED_SOURCE_FILE_NAMES to be the list of Intel-only libraries and the list of PPC-only libraries.  When Xcode performs each build phase in the target for that architecture, it will toss out all files in the build phase that match any filename in that build setting.  That means that your Intel-only libraries will be skipped for the PPC build and vice versa.

This technique works with all file types in all build phases, so it can be used for selective compilation, resource copying, etc.  You can use the same technique with other build setting values than $(CURRENT_ARCH) to do per-variant links as well (debug, profile, etc.)

Make sure to add the build settings to All Configurations of the target so that your Debug and Release configurations do the same thing.

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

References: 
 >Per-processor type framework linking? (From: "Blair M. Burtan" <email@hidden>)

  • Prev by Date: Re: Gratuitous rebuilds in Xcode 2.3
  • Next by Date: Re: Gratuitous rebuilds in Xcode 2.3
  • Previous by thread: Re: Per-processor type framework linking?
  • Next by thread: Re: Targets and include files..
  • Index(es):
    • Date
    • Thread