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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 | 1089 |
1090 def GetExtraPlistItems(self, configname=None): | 1090 def GetExtraPlistItems(self, configname=None): |
1091 """Returns a dictionary with extra items to insert into Info.plist.""" | 1091 """Returns a dictionary with extra items to insert into Info.plist.""" |
1092 if configname not in XcodeSettings._plist_cache: | 1092 if configname not in XcodeSettings._plist_cache: |
1093 cache = {} | 1093 cache = {} |
1094 cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() | 1094 cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() |
1095 | 1095 |
1096 xcode, xcode_build = XcodeVersion() | 1096 xcode, xcode_build = XcodeVersion() |
1097 cache['DTXcode'] = xcode | 1097 cache['DTXcode'] = xcode |
1098 cache['DTXcodeBuild'] = xcode_build | 1098 cache['DTXcodeBuild'] = xcode_build |
| 1099 compiler = self.xcode_settings[configname].get('GCC_VERSION') |
| 1100 if compiler is not None: |
| 1101 cache['DTCompiler'] = compiler |
1099 | 1102 |
1100 sdk_root = self._SdkRoot(configname) | 1103 sdk_root = self._SdkRoot(configname) |
1101 if not sdk_root: | 1104 if not sdk_root: |
1102 sdk_root = self._DefaultSdkRoot() | 1105 sdk_root = self._DefaultSdkRoot() |
1103 cache['DTSDKName'] = sdk_root | 1106 sdk_version = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-version') |
1104 if xcode >= '0430': | 1107 cache['DTSDKName'] = sdk_root + sdk_version |
| 1108 if xcode >= '0720': |
1105 cache['DTSDKBuild'] = self._GetSdkVersionInfoItem( | 1109 cache['DTSDKBuild'] = self._GetSdkVersionInfoItem( |
1106 sdk_root, '--show-sdk-version') | 1110 sdk_root, '--show-sdk-build-version') |
| 1111 elif xcode >= '0430': |
| 1112 cache['DTSDKBuild'] = sdk_version |
1107 else: | 1113 else: |
1108 cache['DTSDKBuild'] = cache['BuildMachineOSBuild'] | 1114 cache['DTSDKBuild'] = cache['BuildMachineOSBuild'] |
1109 | 1115 |
1110 if self.isIOS: | 1116 if self.isIOS: |
1111 cache['DTPlatformName'] = cache['DTSDKName'] | 1117 cache['MinimumOSVersion'] = self.xcode_settings[configname].get( |
| 1118 'IPHONEOS_DEPLOYMENT_TARGET') |
| 1119 cache['DTPlatformName'] = sdk_root |
| 1120 cache['DTPlatformVersion'] = sdk_version |
| 1121 |
1112 if configname.endswith("iphoneos"): | 1122 if configname.endswith("iphoneos"): |
1113 cache['DTPlatformVersion'] = self._GetSdkVersionInfoItem( | |
1114 sdk_root, '--show-sdk-version') | |
1115 cache['CFBundleSupportedPlatforms'] = ['iPhoneOS'] | 1123 cache['CFBundleSupportedPlatforms'] = ['iPhoneOS'] |
| 1124 cache['DTPlatformBuild'] = cache['DTSDKBuild'] |
1116 else: | 1125 else: |
1117 cache['CFBundleSupportedPlatforms'] = ['iPhoneSimulator'] | 1126 cache['CFBundleSupportedPlatforms'] = ['iPhoneSimulator'] |
| 1127 # This is weird, but Xcode sets DTPlatformBuild to an empty field |
| 1128 # for simulator builds. |
| 1129 cache['DTPlatformBuild'] = "" |
1118 XcodeSettings._plist_cache[configname] = cache | 1130 XcodeSettings._plist_cache[configname] = cache |
1119 | 1131 |
1120 # Include extra plist items that are per-target, not per global | 1132 # Include extra plist items that are per-target, not per global |
1121 # XcodeSettings. | 1133 # XcodeSettings. |
1122 items = dict(XcodeSettings._plist_cache[configname]) | 1134 items = dict(XcodeSettings._plist_cache[configname]) |
1123 if self.isIOS: | 1135 if self.isIOS: |
1124 items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) | 1136 items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) |
1125 return items | 1137 return items |
1126 | 1138 |
1127 def _DefaultSdkRoot(self): | 1139 def _DefaultSdkRoot(self): |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 if toolset == 'target': | 1655 if toolset == 'target': |
1644 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1656 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
1645 return targets | 1657 return targets |
1646 | 1658 |
1647 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1659 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
1648 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1660 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
1649 targets for iOS device builds.""" | 1661 targets for iOS device builds.""" |
1650 if _HasIOSTarget(target_dicts): | 1662 if _HasIOSTarget(target_dicts): |
1651 return _AddIOSDeviceConfigurations(target_dicts) | 1663 return _AddIOSDeviceConfigurations(target_dicts) |
1652 return target_dicts | 1664 return target_dicts |
OLD | NEW |