From d555327a57cb1419fbc19c7dd0b12f6c845598a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 19 Oct 2018 14:16:04 +0200 Subject: [PATCH] macOS: Explicitly define lower bound for supported SDK version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to support apps building against the 10.13 SDK, so that they can opt out of dark mode and layer-backing. This does not mean we can't require 10.14 to build Qt itself, but doing so should not require the app to also build against the 10.14 SDK. Change-Id: I53bd0fc8bf56c0be6614acec14d5173589e2620f Reviewed-by: Timur Pocheptsov Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- mkspecs/common/macx.conf | 3 ++- mkspecs/features/mac/default_post.prf | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf index d61ad333512..889027ada51 100644 --- a/mkspecs/common/macx.conf +++ b/mkspecs/common/macx.conf @@ -7,7 +7,8 @@ QMAKE_MAC_SDK = macosx QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 QMAKE_APPLE_DEVICE_ARCHS = x86_64 -QT_MAC_SDK_VERSION_TESTED_WITH = 10.14 +QT_MAC_SDK_VERSION_MIN = 10.13 +QT_MAC_SDK_VERSION_MAX = 10.14 device.sdk = macosx device.target = device diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index ae17f076a35..5d3ab7ed6ee 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -9,19 +9,22 @@ contains(TEMPLATE, .*app) { # 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," \ + isEmpty(QT_MAC_SDK_VERSION_MIN): \ + QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION + + !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_MIN): \ + warning("Qt requires at least version $$QT_MAC_SDK_VERSION_MIN of the platform SDK," \ "you're using $${QMAKE_MAC_SDK_VERSION}. Please upgrade.") - !isEmpty(QT_MAC_SDK_VERSION_TESTED_WITH) { + !isEmpty(QT_MAC_SDK_VERSION_MAX) { # For Qt developers only !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \ CONFIG += sdk_no_version_check QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\d+)(\.\d+)(\.\d+)?", \1\2) - !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_TESTED_WITH) { - warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_TESTED_WITH"\ + !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) { + warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\ "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_MINOR_VERSION}.") warning("This is an unsupported configuration. You may experience build issues," \ "and by using") @@ -29,7 +32,7 @@ contains(TEMPLATE, .*app) { "that Qt has not been prepared for.") warning("Please downgrade the SDK you use to build your app to version" \ - "$$QT_MAC_SDK_VERSION_TESTED_WITH, or configure") + "$$QT_MAC_SDK_VERSION_MAX, or configure") warning("with CONFIG+=sdk_no_version_check when running qmake" \ "to silence this warning.") }