diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-11-04 19:41:48 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2014-11-13 20:00:24 +0100 |
commit | 88b2f5e8686ee7b1b7f49012c964f2ec20d6c61e (patch) | |
tree | f8c87c9c7844d3205dd62f1094a480a8a9ff76c1 | |
parent | eca0668a8c76cc5ea273f614500e91de7e706541 (diff) |
iOS: Allow ARCHS to be specified at build time for multi-arch builds
Building all architectures of a multi-arch build during Qt development
is in most cases not needed, so we expose a way to limit the archs we
build by passing ARCHS="subset of archs" to make, similar to how you
can pass ARCHS to xcodebuild. If the subset doesn't match any of the
valid architectures for the target, it will fall back to the default
architectures, so it's safe to pass eg. ARCHS="armv7 i386" to make,
even if building for both simulator and device. The variable may also
be exported to the environment for more persistent limits on which
architectures to build.
Change-Id: I47b10bc9d743f0301efff4181d6881ae140d557f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
-rw-r--r-- | mkspecs/macx-ios-clang/features/default_post.prf | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 5da95f16bf..34fbac56d0 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -205,18 +205,21 @@ macx-xcode { } else { # Be more specific about which architecture we're targeting contains(QT_ARCH, arm.*): \ - actual_archs = $$QMAKE_IOS_DEVICE_ARCHS + VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS else: \ - actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS + VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS - for(arch, actual_archs): \ - arch_flags += -arch $$arch + ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS)) + ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch)) + + QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS + + arch_flags = $(EXPORT_ARCH_ARGS) QMAKE_CFLAGS += $$arch_flags QMAKE_CXXFLAGS += $$arch_flags QMAKE_OBJECTIVE_CFLAGS += $$arch_flags QMAKE_LFLAGS += $$arch_flags } -unset(actual_archs) load(default_post) |