summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-09 12:13:01 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-09 12:13:02 +0200
commit1f1e2aa57b480f0b227e11d0cff0b3cfcffb1f39 (patch)
tree9d5a045b3fea13486cf6108fd9ef641f3a1f5135 /mkspecs
parent3bac18da8ef9f5750207ddf47192b5db3137c4ac (diff)
parent9da5b6f7432dc1d87cec94040ede69cb2f7ff537 (diff)
Merge remote-tracking branch 'origin/5.11.2' into 5.11
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/macx.conf2
-rw-r--r--mkspecs/features/mac/default_post.prf38
-rw-r--r--mkspecs/features/mac/sdk.mk12
3 files changed, 52 insertions, 0 deletions
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index 4be0eb3c39..8f9eda10d7 100644
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -5,6 +5,8 @@
QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
+QT_MAC_SDK_VERSION_TESTED_WITH = 10.13
+
device.sdk = macosx
device.target = device
device.dir_affix = $${device.sdk}
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index c6eb7c5a2c..353fda41e6 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,5 +1,43 @@
load(default_post)
+contains(TEMPLATE, .*app) {
+ !macx-xcode {
+ # Detect changes to the platform SDK
+ QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION
+ QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
+ }
+
+ # Detect incompatible SDK versions
+
+ !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION): \
+ warning("Qt requires at least version $$QT_MAC_SDK_VERSION of the platform SDK," \
+ "you're using $${QMAKE_MAC_SDK_VERSION}. Please upgrade.")
+
+ !isEmpty(QT_MAC_SDK_VERSION_TESTED_WITH) {
+ # For Qt developers only
+ !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
+ CONFIG += sdk_no_version_check
+
+ !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_TESTED_WITH) {
+ warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_TESTED_WITH"\
+ "of the platform SDK, you're using $${QMAKE_MAC_SDK_VERSION}.")
+ warning("This is an unsupported configuration. You may experience build issues," \
+ "and by using")
+ warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
+ "that Qt has not been prepared for.")
+
+ isEqual(QMAKE_MAC_SDK_VERSION, 10.14): \
+ warning("E.g., 10.14 enables dark mode and layer-backed views," \
+ "which Qt $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION} does not support.")
+
+ warning("Please downgrade the SDK you use to build your app to version" \
+ "$$QT_MAC_SDK_VERSION_TESTED_WITH, or configure")
+ warning("with CONFIG+=sdk_no_version_check when running qmake" \
+ "to silence this warning.")
+ }
+ }
+}
+
!no_objective_c:CONFIG += objective_c
qt {
diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
new file mode 100644
index 0000000000..a7c8268da5
--- /dev/null
+++ b/mkspecs/features/mac/sdk.mk
@@ -0,0 +1,12 @@
+CURRENT_MAC_SDK_VERSION := $(shell /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version)
+
+ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
+ $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
+ $(info This requires a fresh build. Please wipe the build directory completely,)
+ $(info including any .qmake.stash and .qmake.cache files generated by qmake.)
+ # FIXME: Ideally this should be advertised as just running make distclean, or we
+ # should even do it automatically by having proper makefile dependencies between
+ # .qmake.stash and the SDK version, but as qmake doesn't seem to be consistent in
+ # how it deals with .qmake.stash as a dependency we need to defer that until later.
+ $(error ^)
+endif