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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 XcodeSettings._plist_cache[configname] = cache | 903 XcodeSettings._plist_cache[configname] = cache |
904 | 904 |
905 # Include extra plist items that are per-target, not per global | 905 # Include extra plist items that are per-target, not per global |
906 # XcodeSettings. | 906 # XcodeSettings. |
907 items = dict(XcodeSettings._plist_cache[configname]) | 907 items = dict(XcodeSettings._plist_cache[configname]) |
908 if self.isIOS: | 908 if self.isIOS: |
909 items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) | 909 items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) |
910 return items | 910 return items |
911 | 911 |
912 def _DefaultArch(self): | 912 def _DefaultArch(self): |
913 # The default value for ARCHS changed from ['i386'] to ['x86_64'] in | 913 # For Mac projects, Xcode changed the default value used when ARCHS is not |
914 # Xcode 5. | 914 # set from "i386" to "x86_64". |
| 915 # |
| 916 # For iOS projects, if ARCHS is unset, it defaults to "armv7 armv7s" when |
| 917 # building for a device, and the simulator binaries are always build for |
| 918 # "i386". |
| 919 # |
| 920 # For new projects, ARCHS is set to $(ARCHS_STANDARD_INCLUDING_64_BIT), |
| 921 # which correspond to "armv7 armv7s arm64", and when building the simulator |
| 922 # the architecture is either "i386" or "x86_64" depending on the simulated |
| 923 # device (respectively 32-bit or 64-bit device). |
| 924 # |
| 925 # Since the value returned by this function is only used when ARCHS is not |
| 926 # set, then on iOS we return "i386", as the default xcode project generator |
| 927 # does not set ARCHS if it is not set in the .gyp file. |
| 928 if self.isIOS: |
| 929 return 'i386' |
915 version, build = self._XcodeVersion() | 930 version, build = self._XcodeVersion() |
916 if version >= '0500': | 931 if version >= '0500': |
917 return 'x86_64' | 932 return 'x86_64' |
918 return 'i386' | 933 return 'i386' |
919 | 934 |
920 class MacPrefixHeader(object): | 935 class MacPrefixHeader(object): |
921 """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. | 936 """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. |
922 | 937 |
923 This feature consists of several pieces: | 938 This feature consists of several pieces: |
924 * If GCC_PREFIX_HEADER is present, all compilations in that project get an | 939 * If GCC_PREFIX_HEADER is present, all compilations in that project get an |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1338 new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
1324 target_dict['configurations'][new_config_name] = new_config_dict | 1339 target_dict['configurations'][new_config_name] = new_config_dict |
1325 return targets | 1340 return targets |
1326 | 1341 |
1327 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1342 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
1328 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1343 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
1329 targets for iOS device builds.""" | 1344 targets for iOS device builds.""" |
1330 if _HasIOSTarget(target_dicts): | 1345 if _HasIOSTarget(target_dicts): |
1331 return _AddIOSDeviceConfigurations(target_dicts) | 1346 return _AddIOSDeviceConfigurations(target_dicts) |
1332 return target_dicts | 1347 return target_dicts |
OLD | NEW |