summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-10 09:11:00 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-10 12:12:46 +0200
commit683e144efbd91163795dc582aedc210c7d78de4d (patch)
tree2211fffdbaad8bad9569f63e017e7caf85eec2b6 /mkspecs
parentb66357e3ebf3e3dbda04f880e87184e247882843 (diff)
parent1f1e2aa57b480f0b227e11d0cff0b3cfcffb1f39 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts: mkspecs/common/macx.conf Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/macx.conf1
-rw-r--r--mkspecs/features/mac/default_post.prf38
-rw-r--r--mkspecs/features/mac/sdk.mk12
3 files changed, 51 insertions, 0 deletions
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index 8122a54d9d..6e95112f9b 100644
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -7,6 +7,7 @@ QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_APPLE_DEVICE_ARCHS = x86_64
+QT_MAC_SDK_VERSION_TESTED_WITH = 10.13
device.sdk = macosx
device.target = device
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