8b50386b08
Change-Id: I9e9f9b033cc892a35c86b35f64dc1dd915ad44f3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
73 lines
2.8 KiB
Plaintext
73 lines
2.8 KiB
Plaintext
|
|
isEmpty(QMAKE_MAC_SDK): \
|
|
error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
|
|
|
|
contains(QMAKE_MAC_SDK, .*/.*): \
|
|
error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
|
|
|
|
isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
|
|
QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
|
|
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
|
|
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
|
|
} else {
|
|
QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.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
|
|
|
|
QMAKESPEC_NAME = $$basename(QMAKESPEC)
|
|
|
|
# Resolve SDK version of various tools
|
|
for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB)) {
|
|
tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
|
|
!isEmpty($$tool_variable) {
|
|
$$tool = $$eval($$tool_variable)
|
|
next()
|
|
}
|
|
|
|
value = $$eval($$tool)
|
|
isEmpty(value): next()
|
|
|
|
sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
|
|
isEmpty(sysrooted): next()
|
|
|
|
$$tool = $$sysrooted $$member(value, 1, -1)
|
|
cache($$tool_variable, set stash, $$tool)
|
|
}
|
|
|
|
isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
|
|
QMAKE_MAC_PLATFORM_NAME = $$system("/usr/libexec/PlistBuddy -c 'print DefaultProperties:PLATFORM_NAME' $$QMAKE_MAC_SDK_PATH/SDKSettings.plist 2>/dev/null")
|
|
isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
|
|
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set stash, QMAKE_MAC_PLATFORM_NAME)
|
|
} else {
|
|
QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name)
|
|
}
|
|
|
|
!equals(MAKEFILE_GENERATOR, XCODE) {
|
|
# FIXME: Get the version_min_flag out of the platform's 'Native Build System.xcspec'
|
|
version_identifier = $$replace(QMAKE_MAC_PLATFORM_NAME, iphonesimulator, ios-simulator)
|
|
|
|
# C++11 support may affect the deployment target
|
|
c++11: load(c++11)
|
|
|
|
ios:!host_build: \
|
|
deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
|
|
else: \
|
|
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
|
|
|
|
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
|
|
QMAKE_CFLAGS += $$version_min_flag
|
|
QMAKE_CXXFLAGS += $$version_min_flag
|
|
QMAKE_OBJECTIVE_CFLAGS += $$version_min_flag
|
|
QMAKE_LFLAGS += $$version_min_flag
|
|
}
|