Have XCode choose different source files depending on CPU architecture?

123 views Asked by At

I am using Xcode for a project with fat binary, PPC and x86.

Is it possible to have Xcode for a couple of source files, choose different source files depending on if architecture is x86 or PPC?

I know it's possible to choose different link libraries, so I could solve it by breaking out the architecture dependent files into two different libraries, and choose the correct one in the link settings.

Another solution is to split the project into two projects, one for PPC, the other for x86 and the combine them with lipo. But I would like to avoid these two solutions, if there is a way to make Xcode choose source files depending on architecture.

(A third solution would be to put an include guard around the source files, but that would be a tad bit hackish solution.)

1

There are 1 answers

0
Prof. Falken On BEST ANSWER

I decided to try out combining binaries with lipo instead. This meant having two projects, but that's OK. Worked beautifully.