From 88b2f5e8686ee7b1b7f49012c964f2ec20d6c61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 4 Nov 2014 19:41:48 +0100 Subject: 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 --- mkspecs/macx-ios-clang/features/default_post.prf | 13 ++++++++----- 1 file 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) -- cgit v1.2.3