• 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: How to build some files for some destinations/architecture only?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to build some files for some destinations/architecture only?


  • Subject: Re: How to build some files for some destinations/architecture only?
  • From: Steve Mills <email@hidden>
  • Date: Fri, 23 Sep 2011 09:21:10 -0500

On Sep 23, 2011, at 08:44:40, Jean-Denis MUYS wrote:

> 1- How am I to setup my Xcode 4.x project so that some files are included in the build process of some destinations only?
> 2- How am I to setup my Xcode 4.x project so that some files are included in the build process of some architecture only?

You add a sort of "traffic cop" source file to the Compile Sources build phase. This file will have compiler directives to choose which actual source files to include:

#if building_intel
	#include "IntelOnlySource.c"
#else
	#include "PPCOnlySource.c"
#endif

etc. And you do NOT add the actual source files (IntelOnlySource.c, etc) to the Compile Sources build phase. That would defeat the purpose.

Or, rather than use a traffic cop, why not just put those compiler directives around the entire content of each source file? So IntelOnlySource.c would look like:

#if building_intel

void blah(void)
{
}

#endif

This is probably the better way to go and will cause fewer moments of confusion in the future if somebody else is working on the code, wondering why some source files aren't in the build phase.

--
Steve Mills
Drummer, Mac geek

 _______________________________________________
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: How to build some files for some destinations/architecture only?
      • From: Jean-Denis MUYS <email@hidden>
  • Prev by Date: How to build some files for some destinations/architecture only?
  • Next by Date: Re: How to build some files for some destinations/architecture only?
  • Previous by thread: How to build some files for some destinations/architecture only?
  • Next by thread: Re: How to build some files for some destinations/architecture only?
  • Index(es):
    • Date
    • Thread