summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/mac/default_post.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/mac/default_post.prf')
-rw-r--r--mkspecs/features/mac/default_post.prf60
1 files changed, 25 insertions, 35 deletions
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index abc6d82ade..22c84d6473 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -17,6 +17,7 @@ contains(TEMPLATE, .*app) {
}
# Detect incompatible SDK versions
+ # The CMake equivalent is in cmake/QtPublicAppleHelpers.cmake.
isEmpty(QT_MAC_SDK_VERSION_MIN): \
QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION
@@ -50,29 +51,6 @@ contains(TEMPLATE, .*app) {
!no_objective_c:CONFIG += objective_c
-qt {
- qtConfig(static) {
- # C++11 support means using libc++ instead of libstd++. As the
- # two libraries are incompatible we need to ensure the end user
- # project is built using the same C++11 support/no support as Qt.
- qtConfig(c++11) {
- CONFIG += c++11
- } else: c++11 {
- warning("Qt was not built with C++11 enabled, disabling feature")
- CONFIG -= c++11
- }
-
- !c++11 {
- # Explicitly use libstdc++ if C++11 support is not enabled,
- # as otherwise the compiler will choose the standard library
- # based on the deployment target, which for iOS 7 and OS X 10.9
- # is libc++, and we can't mix and match the two.
- QMAKE_CXXFLAGS += -stdlib=libstdc++
- QMAKE_LFLAGS += -stdlib=libstdc++
- }
- }
-}
-
# Add the same default rpaths as Xcode does for new projects.
# This is especially important for iOS/tvOS/watchOS where no other option is possible.
!no_default_rpath {
@@ -142,12 +120,14 @@ macx-xcode {
QMAKE_XCODE_ARCHS =
- arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
- arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_MAC_XCODE_SETTINGS += arch_device
+ !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
+ arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
+ arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
+ QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
+ QMAKE_MAC_XCODE_SETTINGS += arch_device
+ }
- simulator {
+ ios:simulator {
arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
@@ -160,7 +140,7 @@ macx-xcode {
QMAKE_MAC_XCODE_SETTINGS += only_active_arch
} else {
device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
- simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
+ ios:simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
@@ -199,7 +179,7 @@ macx-xcode {
# and makes it easier for people to override EXPORT_VALID_ARCHS to limit
# individual rules to a different set of architecture(s) from the overall
# build (such as machtest in QtCore).
- simulator:device {
+ ios:simulator:device {
QMAKE_XARCH_CFLAGS =
QMAKE_XARCH_LFLAGS =
QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
@@ -208,9 +188,11 @@ macx-xcode {
contains(VALID_SIMULATOR_ARCHS, $$arch) {
sdk = $$simulator.sdk
version_identifier = $$simulator.deployment_identifier
+ platform_identifier = $$simulator.sdk
} else {
sdk = $$device.sdk
version_identifier = $$device.deployment_identifier
+ platform_identifier = $$device.sdk
}
version_min_flags = \
@@ -235,17 +217,25 @@ macx-xcode {
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
} else {
- simulator {
+ ios:simulator {
version_identifier = $$simulator.deployment_identifier
+ platform_identifier = $$simulator.sdk
sysroot_path = $$xcodeSDKInfo(Path, $$simulator.sdk)
} else {
version_identifier = $$device.deployment_identifier
+ platform_identifier = $$device.sdk
sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk)
}
- version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
- QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
+ QMAKE_CFLAGS += -isysroot $$sysroot_path
+ QMAKE_CXXFLAGS += -isysroot $$sysroot_path
+ QMAKE_LFLAGS += -isysroot $$sysroot_path
+
+ !isEmpty(version_identifier):!isEmpty(deployment_target) {
+ version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+ QMAKE_CFLAGS += $$version_min_flag
+ QMAKE_CXXFLAGS += $$version_min_flag
+ QMAKE_LFLAGS += $$version_min_flag
+ }
}
# Enable precompiled headers for multiple architectures