Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """ | 5 """ |
| 6 This module contains classes that help to emulate xcodebuild behavior on top of | 6 This module contains classes that help to emulate xcodebuild behavior on top of |
| 7 other build systems, such as make and ninja. | 7 other build systems, such as make and ninja. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import copy | 10 import copy |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 939 return '' | 939 return '' |
| 940 | 940 |
| 941 def _DefaultArch(self): | 941 def _DefaultArch(self): |
| 942 # For Mac projects, Xcode changed the default value used when ARCHS is not | 942 # For Mac projects, Xcode changed the default value used when ARCHS is not |
| 943 # set from "i386" to "x86_64". | 943 # set from "i386" to "x86_64". |
| 944 # | 944 # |
| 945 # For iOS projects, if ARCHS is unset, it defaults to "armv7 armv7s" when | 945 # For iOS projects, if ARCHS is unset, it defaults to "armv7 armv7s" when |
| 946 # building for a device, and the simulator binaries are always build for | 946 # building for a device, and the simulator binaries are always build for |
| 947 # "i386". | 947 # "i386". |
| 948 # | 948 # |
| 949 # For new projects, ARCHS is set to $(ARCHS_STANDARD_INCLUDING_64_BIT), | 949 # For new projects, ARCHS is set to $(ARCHS_STANDARD_INCLUDING_64_BIT), |
|
Mark Mentovai
2014/03/11 16:06:23
Fix?
sdefresne
2014/03/22 12:54:36
Done.
| |
| 950 # which correspond to "armv7 armv7s arm64", and when building the simulator | 950 # which correspond to "armv7 armv7s arm64", and when building the simulator |
| 951 # the architecture is either "i386" or "x86_64" depending on the simulated | 951 # the architecture is either "i386" or "x86_64" depending on the simulated |
| 952 # device (respectively 32-bit or 64-bit device). | 952 # device (respectively 32-bit or 64-bit device). |
| 953 # | 953 # |
| 954 # Since the value returned by this function is only used when ARCHS is not | 954 # Since the value returned by this function is only used when ARCHS is not |
| 955 # set, then on iOS we return "i386", as the default xcode project generator | 955 # set, then on iOS we return "i386", as the default xcode project generator |
| 956 # does not set ARCHS if it is not set in the .gyp file. | 956 # does not set ARCHS if it is not set in the .gyp file. |
| 957 if self.isIOS: | 957 if self.isIOS: |
| 958 return 'i386' | 958 return 'i386' |
| 959 version, build = XcodeVersion() | 959 version, build = XcodeVersion() |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1442 def _IOSDefaultArchForSDKRoot(sdkroot): | 1442 def _IOSDefaultArchForSDKRoot(sdkroot): |
| 1443 """Returns the expansion of standard ARCHS macro depending on the version | 1443 """Returns the expansion of standard ARCHS macro depending on the version |
| 1444 of Xcode installed and configured, and which |sdkroot| to use (iphoneos or | 1444 of Xcode installed and configured, and which |sdkroot| to use (iphoneos or |
| 1445 simulator).""" | 1445 simulator).""" |
| 1446 xcode_version, xcode_build = XcodeVersion() | 1446 xcode_version, xcode_build = XcodeVersion() |
| 1447 if xcode_version < '0500': | 1447 if xcode_version < '0500': |
| 1448 if _IOSIsDeviceSDKROOT(sdkroot): | 1448 if _IOSIsDeviceSDKROOT(sdkroot): |
| 1449 return {'$(ARCHS_STANDARD)': ['armv7']} | 1449 return {'$(ARCHS_STANDARD)': ['armv7']} |
| 1450 else: | 1450 else: |
| 1451 return {'$(ARCHS_STANDARD)': ['i386']} | 1451 return {'$(ARCHS_STANDARD)': ['i386']} |
| 1452 else: | 1452 elif xcode_version < '0510': |
| 1453 if _IOSIsDeviceSDKROOT(sdkroot): | 1453 if _IOSIsDeviceSDKROOT(sdkroot): |
| 1454 return { | 1454 return { |
| 1455 '$(ARCHS_STANDARD)': ['armv7', 'armv7s'], | 1455 '$(ARCHS_STANDARD)': ['armv7', 'armv7s'], |
| 1456 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['armv7', 'armv7s', 'arm64'], | 1456 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['armv7', 'armv7s', 'arm64'], |
| 1457 } | 1457 } |
| 1458 else: | 1458 else: |
| 1459 return { | 1459 return { |
| 1460 '$(ARCHS_STANDARD)': ['i386'], | 1460 '$(ARCHS_STANDARD)': ['i386'], |
| 1461 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['i386', 'x86_64'], | 1461 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['i386', 'x86_64'], |
| 1462 } | 1462 } |
| 1463 else: | |
| 1464 if _IOSIsDeviceSDKROOT(sdkroot): | |
| 1465 return { | |
| 1466 '$(ARCHS_STANDARD)': ['armv7', 'armv7s', 'arm64'], | |
| 1467 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['armv7', 'armv7s', 'arm64'], | |
| 1468 } | |
| 1469 else: | |
| 1470 return { | |
| 1471 '$(ARCHS_STANDARD)': ['i386', 'x86_64'], | |
| 1472 '$(ARCHS_STANDARD_INCLUDING_64_BIT)': ['i386', 'x86_64'], | |
| 1473 } | |
| 1463 | 1474 |
| 1464 | 1475 |
| 1465 def _FilterIOSArchitectureForSDKROOT(xcode_settings): | 1476 def _FilterIOSArchitectureForSDKROOT(xcode_settings): |
| 1466 """Filter the ARCHS value from the |xcode_settings| dictionary to only | 1477 """Filter the ARCHS value from the |xcode_settings| dictionary to only |
| 1467 contains architectures valid for the sdk configured in SDKROOT value.""" | 1478 contains architectures valid for the sdk configured in SDKROOT value.""" |
| 1468 defaults_archs = _IOSDefaultArchForSDKRoot(xcode_settings.get('SDKROOT', '')) | 1479 defaults_archs = _IOSDefaultArchForSDKRoot(xcode_settings.get('SDKROOT', '')) |
| 1469 allowed_archs = set() | 1480 allowed_archs = set() |
| 1470 for archs in defaults_archs.itervalues(): | 1481 for archs in defaults_archs.itervalues(): |
| 1471 allowed_archs.update(archs) | 1482 allowed_archs.update(archs) |
| 1472 selected_archs = set() | 1483 selected_archs = set() |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1495 _FilterIOSArchitectureForSDKROOT(iphoneos_config_dict['xcode_settings']) | 1506 _FilterIOSArchitectureForSDKROOT(iphoneos_config_dict['xcode_settings']) |
| 1496 _FilterIOSArchitectureForSDKROOT(config_dict['xcode_settings']) | 1507 _FilterIOSArchitectureForSDKROOT(config_dict['xcode_settings']) |
| 1497 return targets | 1508 return targets |
| 1498 | 1509 |
| 1499 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1510 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
| 1500 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1511 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
| 1501 targets for iOS device builds.""" | 1512 targets for iOS device builds.""" |
| 1502 if _HasIOSTarget(target_dicts): | 1513 if _HasIOSTarget(target_dicts): |
| 1503 return _AddIOSDeviceConfigurations(target_dicts) | 1514 return _AddIOSDeviceConfigurations(target_dicts) |
| 1504 return target_dicts | 1515 return target_dicts |
| OLD | NEW |