views:

14

answers:

0

Hi. I have a static lib project with targets for iPhone and for os x. With Xcode 3.2.2 and earlier versions all worked just fine, but in 3.2.3 apple seems to have introduced changes in how to handle target settings. In 3.2.2 I just could choose "base-sdk" from drop-down menu and set up a target for each, iPhone simulator, iPhone device and Mac and xcode would always automatically build for the correct platform and architecture for that target. Now, with xcode 3.2.3 and later you can't choose this option any more. Switching between targets for simulator or device does not have influence on the platform, you build for, anymore. You always have to choose the platform separately and then all targets are build for that platform. This issue is already described for simulator vs device here: http://stackoverflow.com/questions/3160787/targeting-multiple-platforms-in-iphone-sdk-4 For iPhone only projects I could live with it and just only have one target and choose the platform separately from the target.

The real issue with that change is with having an iPhone and a mac target in the project: if the mac target is chosen, you do not have the option anymore, to switch between device and simulator, but they still affect the mac target. If the platform has been set to device prior to switching active target from iPhone to mac, than xcode does not find the CoreServices for the mac target, because it is searching in iPhone device frameworks, where this isn't existing. Xcode even builds for arm in this case, also the target settings clearly tell it to build for i386. If switching back to iPhone target an setting the platform to simulator and then switching back again to mac target, CoreServices framework is found, but the simulator one is used, not the os x one, which leads into the issue of dozens of "error: expected declaration specifiers or '...' before 'CFXMLTreeRef'" errors in the iphone simulator core services framework, where this is not defined, although I do of course want to use the mac version of the framework for mac target.

As I already mentioned, this was all working fine before Xcode version 3.2.3. Projects only for iPhone or only for mac are still building fine.

Any ideas, how I can get projects with static libs targets for iPhone and for mac, to build with Xcode 3.2.3 and later versions?