views:

101

answers:

1

Hi all,

I've created a iPhone static library project with two targets like this

Project
--> Library (Device) target
--> Library (simulator) target

The device target has the SDK set to the device so it produces an armv6/7 library and the simulator target is set to the simulator SDK so it produces an i386 library.

The issue I'm having is that the SDK settings on the targets keep getting overridden by the XCode active target setting. i.e. if I build the device target, but the XCode window is showing the active SDK as being the simlulator, XCode will build a simulator library instead of a device library, ignoring the settings of the target. Although it will put it into the *-iphoneos/ directory in the build directories!

I originally had the same issue with another static library project, and after a lot of playing around got everything to work correctly. i.e. The targets ignore the XCode active SDK because they have their own specifications of what to build.

The problem is that I don't know what made it work in that project and I have not been able to reproduce the issue in it either.

Does anyone have any ideas as to what is going on?

ciao Derek

+1  A: 

OK, I think I've figured it out.

Set the project SDK to the general setting, ie. Simulator SDK so that you get the APIs and libraries correct during coding.

Set each target to the SKD it needs to build. ie. device SDK or simulator SDK.

Leave XCodes SDK set to current SDK, effectively telling it to not override the targets.

Derek Clarkson