From 39c62b01bacef81e1a91c219f1855b92ca18602b Mon Sep 17 00:00:00 2001 From: "lliabraa@chromium.org" Date: Wed, 11 Sep 2013 20:49:22 +0000 Subject: [PATCH] For iOS, don't override VALID_ARCHS in Debug configuration. When Xcode recognizes a device, it sets the active arch to the arch of the device. Since the Debug configuration is set to only compile for the active arch, Xcode was failing to build when an iPhone 5 was connected because that device uses armv7s which is not in the list of VALID_ARCHS. This CL uses the default value of VALID_ARCHS for Debug so that Xcode will build no matter what device is connected. This CL also moves the arch-twiddling into an OS=="ios" block to make it clear that the configurations are only needed for iOS. BUG=None Review URL: https://chromiumcodereview.appspot.com/23535007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222625 0039d316-1c4b-4281-b951-d872f2087c98 --- build/common.gypi | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/build/common.gypi b/build/common.gypi index e2c7719279b2..26039a7442c2 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -4664,13 +4664,29 @@ # This block adds *project-wide* configuration settings to each project # file. It's almost always wrong to put things here. Specify your # custom |configurations| in target_defaults to add them to targets instead. - 'Debug': { - 'xcode_settings': { - # Enable 'Build Active Architecture Only' for Debug. This - # avoids a project-level warning in Xcode. - 'ONLY_ACTIVE_ARCH': 'YES', - }, - }, + 'conditions': [ + ['OS=="ios"', { + 'Debug': { + 'xcode_settings': { + # Enable 'Build Active Architecture Only' for Debug. This + # avoids a project-level warning in Xcode. + # Note that this configuration uses the default VALID_ARCHS value + # because if there is a device connected Xcode sets the active arch + # to the arch of the device. In cases where the device's arch is not + # in VALID_ARCHS (e.g. iPhone5 is armv7s) Xcode complains because it + # can't determine what arch to compile for. + 'ONLY_ACTIVE_ARCH': 'YES', + }, + }, + 'Release': { + 'xcode_settings': { + # Override VALID_ARCHS and omit armv7s. Otherwise Xcode compiles for + # both armv7 and armv7s, doubling the binary size. + 'VALID_ARCHS': 'armv7 i386', + }, + }, + }], + ], }, 'xcode_settings': { # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! @@ -4709,8 +4725,6 @@ ], }], ['OS=="ios"', { - # Just build armv7, until armv7s is correctly tested. - 'VALID_ARCHS': 'armv7 i386', # Target both iPhone and iPad. 'TARGETED_DEVICE_FAMILY': '1,2', }], -- 2.11.4.GIT