diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-08-31 12:33:08 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-08-31 12:25:23 +0000 |
commit | 4e4057460a0b27e4a8eff749fb284f61f245982e (patch) | |
tree | 0ebf892d8df24d40281acdfcbb33a34a37a4f37d /mkspecs | |
parent | 3ed306772eb333fb4d9fa0b0a003c119e848ed58 (diff) |
macOS: Warn the user when using incompatible or untested platform SDKs
Task-number: QTBUG-70263
Change-Id: Ic946d1efc69ebb8ba65bbba956ed55ab7183957e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/macx.conf | 2 | ||||
-rw-r--r-- | mkspecs/features/mac/default_post.prf | 40 |
2 files changed, 38 insertions, 4 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 adc796f395..353fda41e6 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,9 +1,41 @@ load(default_post) -# Detect changes to the platform SDK. Apps only for now -contains(TEMPLATE, .*app):!macx-xcode { - QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION - QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) +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 |