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: Jean-Denis MUYS <email@hidden>
- Date: Fri, 23 Sep 2011 14:57:47 +0000
- Thread-topic: How to build some files for some destinations/architecture only?
On 23 sept. 2011, at 16:21, Steve Mills wrote:
> 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.
Yes I know about handling that at the C compiler level. But:
1- It's ugly to have to handle build issues at the source-level
2- This sounds like a C-solution only. Unless the C-preprocessor is run on .s files too? I would hate being limited to inline assembly.
JD
_______________________________________________
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