summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/android/sdk.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf32
-rw-r--r--mkspecs/features/mac/default_pre.prf21
-rw-r--r--mkspecs/features/qt_docs.prf14
-rw-r--r--mkspecs/features/toolchain.prf11
5 files changed, 62 insertions, 18 deletions
diff --git a/mkspecs/features/android/sdk.prf b/mkspecs/features/android/sdk.prf
index b8df6dc1c6..83428ae7d7 100644
--- a/mkspecs/features/android/sdk.prf
+++ b/mkspecs/features/android/sdk.prf
@@ -1,6 +1,6 @@
API_VERSION_TO_USE = $$(ANDROID_API_VERSION)
isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION
-isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-30
+isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-31
ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
!exists($$ANDROID_JAR_FILE) {
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 4020f68895..abc6d82ade 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -34,7 +34,7 @@ contains(TEMPLATE, .*app) {
!sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_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}.")
+ "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_VERSION}.")
warning("This is an unsupported configuration. You may experience build issues," \
"and by using")
warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
@@ -95,6 +95,19 @@ app_extension_api_only {
QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
}
+macos {
+ !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
+ # If the user has requested a specific set of architectures,
+ # build all of those by default, but limited to only those.
+ CONFIG -= only_active_arch
+ } else {
+ # Otherwise allow building all of the architectures available
+ # in Qt, but only build the active arch (unless the user has
+ # manually overridden this via CONFIG -= only_active_arch).
+ QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS
+ }
+}
+
macx-xcode {
qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
!isEmpty(QMAKE_PKGINFO_TYPEINFO): \
@@ -150,15 +163,20 @@ macx-xcode {
simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
- isEmpty(VALID_ARCHS): \
- error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
-
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
- ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
- ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
+ macos {
+ only_active_arch: DEFAULT_ARCHS = $$system("uname -m")
+ else: DEFAULT_ARCHS = $$VALID_ARCHS
+ }
+
+ ARCHS = $(filter $(EXPORT_VALID_ARCHS), \
+ $(if $(ARCHS), $(ARCHS), \
+ $(if $(EXPORT_DEFAULT_ARCHS), $(EXPORT_DEFAULT_ARCHS), \
+ $(EXPORT_VALID_ARCHS))))
+ ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ARCHS), $(EXPORT_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
- QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
+ QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS
arch_flags = $(EXPORT_ARCH_ARGS)
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index e3534561a5..2c91ba6679 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -1,4 +1,25 @@
CONFIG = asset_catalogs rez $$CONFIG
+
+macos {
+ count(QT_ARCHS, 1, >) {
+ # For universal builds all the config tests are run with the first
+ # architecture (as reflected by QT_ARCH). We have to manually enable
+ # CPU features we know exist on the secondary architecture. For
+ # simplicity we just hard-code the base features we know exist.
+ # Note that this hack means we end up with QT_CPU_FEATURES.x86_64
+ # containing neon, and QT_CPU_FEATURES.arm64 containing sse2 e.g.
+ QT_CPU_FEATURES.$$QT_ARCH += sse sse2
+ CONFIG += sse sse2
+ DEFINES += QT_COMPILER_SUPPORTS_SSE2
+ # FIXME: For x86_64 there are a bunch more. If building a universal
+ # build with arm64 as the primary architecture we'll miss those.
+
+ QT_CPU_FEATURES.$$QT_ARCH += neon
+ CONFIG += neon
+ DEFINES += QT_COMPILER_SUPPORTS_NEON
+ }
+}
+
load(default_pre)
isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 095bf15dac..e19d06f788 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -29,20 +29,20 @@ QT_TOOL_ENV =
# On Windows, put the includes into a .inc file which QDoc will read, if the project
# has too many includes. We do this to overcome a command-line limit on Windows.
-WIN_INCLUDETEMP=
+QDOC_WIN_INCLUDETEMP=
INCLUDE_PATHS=$$INCPATH
win32:count(INCLUDE_PATHS, 30, >) {
- WIN_INCLUDETEMP = $$OUT_PWD/qdocincludepaths.inc
- WIN_INCLUDETEMP_CONTENT =
+ QDOC_WIN_INCLUDETEMP = $$OUT_PWD/qdocincludepaths.inc
+ QDOC_WIN_INCLUDETEMP_CONTENT =
for (inc, INCLUDE_PATHS): \
- WIN_INCLUDETEMP_CONTENT += -I$$inc
- write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONTENT)|error()
+ QDOC_WIN_INCLUDETEMP_CONTENT += -I$$inc
+ write_file($$absolute_path($$QDOC_WIN_INCLUDETEMP, $$OUT_PWD), QDOC_WIN_INCLUDETEMP_CONTENT)|error()
}
-isEmpty(WIN_INCLUDETEMP) {
+isEmpty(QDOC_WIN_INCLUDETEMP) {
QDOC_INCLUDE_PATHS=$(INCPATH)
} else {
- QDOC_INCLUDE_PATHS=@$$shell_quote($$WIN_INCLUDETEMP)
+ QDOC_INCLUDE_PATHS=@$$shell_quote($$QDOC_WIN_INCLUDETEMP)
}
macos: QDOC_INCLUDE_PATHS += $$join(QMAKE_DEFAULT_INCDIRS," -I","-I")
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 11ecd6b2a5..0c505fc965 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -182,9 +182,14 @@ isEmpty($${target_prefix}.INCDIRS) {
# UIKit simulator platforms will see the device SDK's sysroot in
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin {
- # Clang doesn't pick up the architecture from the sysroot, and will
- # default to the host architecture, so we need to manually set it.
- cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS
+ uikit {
+ # Clang doesn't automatically pick up the architecture, just because
+ # we're passing the iOS sysroot below, and we will end up building the
+ # test for the host architecture, resulting in linker errors when
+ # linking against the iOS libraries. We work around this by passing
+ # the architecture explicitly.
+ cxx_flags += -arch $$first(QMAKE_APPLE_DEVICE_ARCHS)
+ }
uikit:macx-xcode: \
cxx_flags += -isysroot $$sdk_path_device.value