summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/mac
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/mac')
-rw-r--r--mkspecs/features/mac/asset_catalogs.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf30
-rw-r--r--mkspecs/features/mac/sdk.mk33
-rw-r--r--mkspecs/features/mac/sdk.prf4
4 files changed, 44 insertions, 25 deletions
diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf
index 123a0e0fcd..58211c13a2 100644
--- a/mkspecs/features/mac/asset_catalogs.prf
+++ b/mkspecs/features/mac/asset_catalogs.prf
@@ -110,7 +110,7 @@
# Backwards compatibility
for (bundle_data, QMAKE_BUNDLE_DATA) {
for (bundle_file, $${bundle_data}.files) {
- !contains(bundle_file, .*\.xcassets$): next()
+ !contains(bundle_file, .*\\.xcassets$): next()
warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.")
!exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next()
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index ae17f076a3..c46222debd 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,27 +1,30 @@
load(default_post)
contains(TEMPLATE, .*app) {
- !macx-xcode {
+ !macx-xcode:if(isEmpty(BUILDS)|build_pass) {
# 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)
}
# 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)
+ 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.")
}
@@ -64,7 +67,7 @@ qt {
# Add the same default rpaths as Xcode does for new projects.
# This is especially important for iOS/tvOS/watchOS where no other option is possible.
!no_default_rpath {
- QMAKE_RPATHDIR += @executable_path/Frameworks
+ QMAKE_RPATHDIR += @executable_path/../Frameworks
equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
}
@@ -256,3 +259,10 @@ isEmpty(xcode_product_bundle_target): \
xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
+
+!macx-xcode {
+ generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_)
+ generate_xcode_project.target = xcodeproj
+ QMAKE_EXTRA_VARIABLES += _PRO_FILE_
+ QMAKE_EXTRA_TARGETS += generate_xcode_project
+}
diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
index a7c8268da5..c40f58c987 100644
--- a/mkspecs/features/mac/sdk.mk
+++ b/mkspecs/features/mac/sdk.mk
@@ -1,12 +1,25 @@
-CURRENT_MAC_SDK_VERSION := $(shell /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 ^)
+ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
+ CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>&1
+ CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
+ ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
+ # We don't want to complain about out of date SDK unless the target needs to be remade.
+ # This covers use-cases such as running 'make check' after moving the build to a
+ # computer without Xcode or with a different Xcode version.
+ TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
+ ifeq ($(TARGET_UP_TO_DATE),0)
+ ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
+ $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
+ else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
+ $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
+ else ifneq ($(CURRENT_MAC_SDK_VERSION),)
+ $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
+ else
+ $(info Unknown error resolving current platform SDK version.)
+ endif
+ $(info This requires a fresh build. Please wipe the build directory completely,)
+ $(info including any .qmake.stash and .qmake.cache files generated by qmake.)
+ $(error ^)
+ endif
+ endif
endif
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index 8360dd8b38..50a41657d8 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -33,10 +33,6 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
-sysrootified =
-for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
-QMAKE_INCDIR_OPENGL = $$sysrootified
-
QMAKESPEC_NAME = $$basename(QMAKESPEC)
# Resolve SDK version of various tools