qt5base-lts/mkspecs/features/mac/sdk.prf
Liang Qi ef25620ac1 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	mkspecs/features/mac/default_pre.prf
	mkspecs/features/qpa/genericunixfontdatabase.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/resolve_config.prf
	mkspecs/macx-ios-clang/features/default_post.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	src/corelib/io/qiodevice.cpp

Change-Id: I6f210f71f177a3c3278a4f380542195e14e4b491
2016-10-06 20:12:27 +02:00

122 lines
4.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)")
defineReplace(xcodeSDKInfo) {
info = $$1
sdk = $$2
isEmpty(sdk): \
sdk = $$QMAKE_MAC_SDK
isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcodebuild -sdk $$sdk -version $$info 2>/dev/null")
isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}): error("Could not resolve SDK $$info for \'$$sdk\'")
cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
}
return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
}
QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
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 QMAKE_ACTOOL)) {
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)
}
!equals(MAKEFILE_GENERATOR, XCODE) {
uikit:!host_build {
ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
!simulator|simulator_and_device: device_archs = $$QMAKE_APPLE_DEVICE_ARCHS
simulator: simulator_archs = $$QMAKE_APPLE_SIMULATOR_ARCHS
archs = $$device_archs $$simulator_archs
QMAKE_XARCH_CFLAGS =
QMAKE_XARCH_LFLAGS =
QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
single_arch {
device_archs = $$first(device_archs)
simulator_archs = $$first(simulator_archs)
archs = $$first(archs)
}
for(arch, archs) {
contains(simulator_archs, $$arch) {
sdk = $$simulator.sdk
version_identifier = $$simulator.deployment_identifier
} else {
sdk = $$device.sdk
version_identifier = $$device.deployment_identifier
}
version_min_flags = \
-Xarch_$${arch} \
-m$${version_identifier}-version-min=$$deployment_target
QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-isysroot$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
-Xarch_$${arch} \
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
QMAKE_EXTRA_VARIABLES += \
QMAKE_XARCH_CFLAGS_$${arch} \
QMAKE_XARCH_LFLAGS_$${arch}
}
QMAKE_CFLAGS_USE_PRECOMPILE =
for(arch, archs) {
QMAKE_CFLAGS_USE_PRECOMPILE += \
-Xarch_$${arch} \
-include${QMAKE_PCH_OUTPUT_$${arch}}
}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
} else: osx {
version_identifier = macosx
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
}
QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
}