diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-06-21 21:48:25 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-06-23 13:43:45 +0200 |
commit | b0a9825edb490de9e2af09bb91fb6f1819fd7616 (patch) | |
tree | 563fe8349f84118beeec128f132f4e2832a6bb7a /mkspecs/features | |
parent | 96469ae338c3146f4efea3fabaaae5bc6ecd6a59 (diff) |
macOS: Respect QMAKE_APPLE_DEVICE_ARCHS by building for all those archs
If QMAKE_APPLE_DEVICE_ARCHS is not set, we pick up the available archs
based on what Qt was built with (QT_ARCS), but only build the active
arch.
Pick-to: 6.2
Change-Id: I83273f878022af34a3a0d0eeae8b11d781f78c49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/mac/default_post.prf | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 18a451aaf5..459eff8421 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -95,11 +95,18 @@ app_extension_api_only { QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION } -# Pick up available architectures from what Qt was built with, -# so that our Makefile or Xcode project is set up to build for -# any of the available architectures. -isEmpty(QMAKE_APPLE_DEVICE_ARCHS): \ - QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS +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 @@ -158,15 +165,18 @@ macx-xcode { single_arch: VALID_ARCHS = $$first(VALID_ARCHS) - macos: ACTIVE_ARCH = $$system("uname -m") + macos { + only_active_arch: DEFAULT_ARCHS = $$system("uname -m") + else: DEFAULT_ARCHS = $$VALID_ARCHS + } ARCHS = $(filter $(EXPORT_VALID_ARCHS), \ $(if $(ARCHS), $(ARCHS), \ - $(if $(EXPORT_ACTIVE_ARCH), $(EXPORT_ACTIVE_ARCH), \ + $(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_ARCH ARCHS ARCH_ARGS + QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS arch_flags = $(EXPORT_ARCH_ARGS) |