736e4258a1
Allows us to dynamically generate the command line option for iOS later, and allows the user to override QMAKE_MACOSX_DEPLOYMENT_TARGET with the expected effect on the command line options. We unset PERL5LIB to ensure we get the system Perl libraries, since the Mac OS 10.6 CI machine seems to have a broken XML::Parser::Expat from macports/CPAN. Change-Id: I04430c7b1daf9452d72f9a04a6b7f8d0d6926884 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
45 lines
1.8 KiB
Plaintext
45 lines
1.8 KiB
Plaintext
!host_build:!isEmpty(QMAKE_MAC_SDK) {
|
|
|
|
contains(QMAKE_MAC_SDK, .*/.*): \
|
|
error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
|
|
|
|
QMAKE_MAC_SDK_INFO = $$system("xcodebuild -sdk $$QMAKE_MAC_SDK -version 2>/dev/null", lines)
|
|
isEmpty(QMAKE_MAC_SDK_INFO): error("Could not resolve SDK \'$$QMAKE_MAC_SDK\'")
|
|
|
|
defineReplace(qtMacSDKInfo): \
|
|
return($$replace($$list($$find(QMAKE_MAC_SDK_INFO, ^$$1:)), ^$$1:(.*), \\1))
|
|
|
|
QMAKE_MAC_SDK_PATH = $$qtMacSDKInfo(Path)
|
|
|
|
!equals(MAKEFILE_GENERATOR, XCODE) {
|
|
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
|
|
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
|
|
QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
|
|
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH
|
|
}
|
|
|
|
sysrootified =
|
|
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
|
|
QMAKE_INCDIR_OPENGL = $$sysrootified
|
|
|
|
# We use xml as the output format instead of json since plutil on 10.6 does not have that option
|
|
QMAKE_MAC_PLATFORM_NAME = $$system("plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - | " \
|
|
"PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>&1 | " \
|
|
"sed 's/.*Value: \\(.*\\)/\\1/'")
|
|
|
|
isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
|
|
|
|
} else {
|
|
# Host tools require Mac OS X >= 10.6
|
|
QMAKE_MAC_PLATFORM_NAME = macosx
|
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
|
|
}
|
|
|
|
!equals(MAKEFILE_GENERATOR, XCODE) {
|
|
version_min_flag = -m$${QMAKE_MAC_PLATFORM_NAME}-version-min=$$QMAKE_MACOSX_DEPLOYMENT_TARGET
|
|
QMAKE_CFLAGS += $$version_min_flag
|
|
QMAKE_CXXFLAGS += $$version_min_flag
|
|
QMAKE_OBJECTIVE_CFLAGS += $$version_min_flag
|
|
QMAKE_LFLAGS += $$version_min_flag
|
|
}
|