Commit 88b2f5e8 authored by Tor Arne Vestbø's avatar Tor Arne Vestbø Committed by Jani Heikkinen
Browse files

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: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
Showing with 8 additions and 5 deletions
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment