Re: How to build some files for some destinations/architecture only?
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