From 813ba5d56d2ff5fecb3e15fe12800f601117ad4a Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 17 Aug 2015 16:49:01 -0700 Subject: [PATCH] Build fat binaries on iOS by default unless "ios_active_arch" is specified --- .../flutter/build/config/compiler/BUILD.gn | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/build/config/compiler/BUILD.gn b/engine/src/flutter/build/config/compiler/BUILD.gn index cac77a88b2a..c920299f645 100644 --- a/engine/src/flutter/build/config/compiler/BUILD.gn +++ b/engine/src/flutter/build/config/compiler/BUILD.gn @@ -60,6 +60,14 @@ declare_args() { # The patch is preapplied to the internal toolchain and hence all bots. msvs_xtree_patched = false } + + # By default, iOS executables are fat binaries that contain armv7 and arm64 + # build artifacts. This is suitable for release builds and for testing on + # older devices. However, generating fat binaries takes a very long time, and, + # depending on the application type, may be unnecessary. If the type of + # architecture is known beforehand, setting that as the active arch will + # greatly reduce build times and reduce binary sizes. + ios_active_arch = "" } # default_include_dirs --------------------------------------------------------- @@ -258,10 +266,19 @@ config("compiler") { "i386", ] } else if (current_cpu == "arm") { - common_mac_flags += [ - "-arch", - "arm64", - ] + if (ios_active_arch != "") { + common_mac_flags += [ + "-arch", + ios_active_arch, + ] + } else { + common_mac_flags += [ + "-arch", + "arm64", + "-arch", + "armv7", + ] + } } cflags += common_mac_flags