qt5base-lts/mkspecs/features/mac/sdk.mk
Tor Arne Vestbø 38afa46c47 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>
2018-10-25 08:59:45 +00:00

13 lines
880 B
Makefile

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))
$(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