We have a project (with dependent projects; it's pretty complex) that is set for a 10.4 deployment target, by specifying these settings in the .xcconfig file(s):
MACOSX_DEPLOYMENT_TARGET = 10.4
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk
When building under 'Debug' or 'Release' from Xcode itself, everything is fine. But I want to be able to build from the command line (for instance, to use the awesome Clang static analyzer).
I've tried either specifying the SDK on the command line ("-sdk macosx10.4") or not.
What I'm finding is that xcodebuild seems to be ignoring my request for deploying for a 10.4 base.
I know that for two reasons:
1) I get compile errors where QTMovieLayer.h, in the 10.4u SDK, is trying to access CALayer, something which is only defined in Leopard!
This Leopard-only code will only be compiled if this evaluates true:
#if (QTKIT_VERSION_MAX_ALLOWED >= QTKIT_VERSION_7_2) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
So this means that
2) I have a method that should only be compiled if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4. The compiler has errors finding my method, which means that MAC_OS_X_VERSION_MIN_REQUIRED is set to MAC_OS_X_VERSION_10_5, not MAC_OS_X_VERSION_10_4
I've even tried setting MACOSX_DEPLOYMENT_TARGET=10.4 in the environment before calling xcodebuild (or, indirectly, via scan-build).
Anybody have any suggestions on how to diagnose what's going on?