I have two targets, one for x64-64 and for the other archs supported pre 10.6. I'd like to create a single target that builds them both instead of having to build each separately. I created a single target "Build All", and added both of the targets as dependencies. The problem I've run into is that I can't seem to tell XCode to use different build configurations for each target, so the build fails for one of the targets depending on which build configuration is set. I'm going through this developer doc at Apple: http://developer.apple.com/Mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/300-Build_Settings/bs_build_settings.html hoping it will point in the right direction, if this is possible at all.
No, you can only build one configuration at a time, and all dependent targets are built with the same configuration that the built target is built with. What I'm doing exactly is adding the ability for my app to add itself the user's Login Items. I need to support 10.4-10.6, so there are two ways to do this: 1) Use Apple Events for 10.4 and 10.5 2) Use the LSSharedFileList API for 10.6 My code has #ifndef...#else..#endifs for the different methods. I know 10.5 can use the LSSharedFileList as well, but I can isolate x86-64 in its own target this way. At some point, I'm going to drop support for pre 10.5, but I need to get out one more update before that happens. I found one post in the Xcode archives that explained what I've done so far, but I can't find anything to help with how to handle the configurations. If anyone can set me straight, I'd appreciate it.
The project setup and your code should be the same for all configurations. You should be able to build either Release or Debug of all your targets without regard to this.
You can't combine the products of two separate targets into one binary. So having one target for x86_64/10.6 and another for i386/10.4-10.5 will not work.
What you really need to do is, in all configurations of your one target, select Deployment Target and choose Add Conditional Build Setting... from the gear menu. For the i386 architecture set the Deployment Target to 10.4, and for the x86_64 architecture set the Deployment Target to 10.6. Similarly, for Base SDK set the Base SDK for i386 to 10.4 and the Base SDK for x86_64 to 10.6. Xcode will build your single target twice, once for 10.4/i386 and once for 10.6/x86_64, and combine the two binaries into one app.
Then you can use the #ifdefs in your code to isolate code segments, either by architecture or by #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
Chris |