macOS: Only detect changes to the SDK version within the same developer dir

We want to inform the user when they have upgraded their Xcode version
and hence have a new SDK version, which requires a complete rebuild.

Explicit changes to the Xcode selection (be it via xcode-select or
$DEVELOPER_DIR) do not affect the existing build directory, so we must
record the Xcode selection inside the build to avoid false triggering.

Change-Id: I7d13da1232226712a4951e8a360cf4b634c6fa2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-10-19 14:35:40 +02:00
parent 509d566ec0
commit 38afa46c47
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ load(default_post)
contains(TEMPLATE, .*app) { contains(TEMPLATE, .*app) {
!macx-xcode { !macx-xcode {
# Detect changes to the platform SDK # Detect changes to the platform SDK
QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
} }

View File

@ -1,4 +1,4 @@
CURRENT_MAC_SDK_VERSION := $(shell /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version) CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version)
ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_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 The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)