mkspec macx-ios-clang: ensure SDK version is valid

Ensure the sdk is of recent enough version since:
1. we build Qt with the latest sdk version, so the app needs
    to do the same to avoid compatibility problems e.g when linking.
2. using a launch screen to support iphone6 depends on sdk 8
3. Apple requires apps that are pushed to appstore to use the
    latest version of the sdk.

Ideally we should store the sdk version used to build Qt, and
require that apps use the same version or newer. But this patch
will do until that is in place.

Change-Id: I18b06d09c1eda15122975b7169ca7a3372df6054
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2014-11-08 19:30:56 +01:00
parent 3f7e3b1c24
commit 459a32e39b
2 changed files with 8 additions and 0 deletions

View File

@ -9,8 +9,12 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version SDKVersion 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$$QMAKE_MAC_SDK\'")
cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version, set stash, QMAKE_MAC_SDK_VERSION)
} else {
QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version)
}
!equals(MAKEFILE_GENERATOR, XCODE) {

View File

@ -0,0 +1,4 @@
load(sdk)
lessThan(QMAKE_MAC_SDK_VERSION, "8.0"): \
error("Current $$QMAKE_MAC_SDK SDK version ($$QMAKE_MAC_SDK_VERSION) is too old. Please upgrade Xcode.")