| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 _plist_cache = {} | 155 _plist_cache = {} |
| 156 | 156 |
| 157 # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so | 157 # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so |
| 158 # cached at class-level for efficiency. | 158 # cached at class-level for efficiency. |
| 159 _codesigning_key_cache = {} | 159 _codesigning_key_cache = {} |
| 160 | 160 |
| 161 def __init__(self, spec): | 161 def __init__(self, spec): |
| 162 self.spec = spec | 162 self.spec = spec |
| 163 | 163 |
| 164 self.isIOS = False | 164 self.isIOS = False |
| 165 self.mac_toolchain_dir = None |
| 165 self.header_map_path = None | 166 self.header_map_path = None |
| 166 | 167 |
| 167 # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. | 168 # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. |
| 168 # This means self.xcode_settings[config] always contains all settings | 169 # This means self.xcode_settings[config] always contains all settings |
| 169 # for that config -- the per-target settings as well. Settings that are | 170 # for that config -- the per-target settings as well. Settings that are |
| 170 # the same for all configs are implicitly per-target settings. | 171 # the same for all configs are implicitly per-target settings. |
| 171 self.xcode_settings = {} | 172 self.xcode_settings = {} |
| 172 configs = spec['configurations'] | 173 configs = spec['configurations'] |
| 173 for configname, config in configs.iteritems(): | 174 for configname, config in configs.iteritems(): |
| 174 self.xcode_settings[configname] = config.get('xcode_settings', {}) | 175 self.xcode_settings[configname] = config.get('xcode_settings', {}) |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 # written for bundles: | 1509 # written for bundles: |
| 1509 'TARGET_BUILD_DIR' : built_products_dir, | 1510 'TARGET_BUILD_DIR' : built_products_dir, |
| 1510 'TEMP_DIR' : '${TMPDIR}', | 1511 'TEMP_DIR' : '${TMPDIR}', |
| 1511 'XCODE_VERSION_ACTUAL' : XcodeVersion()[0], | 1512 'XCODE_VERSION_ACTUAL' : XcodeVersion()[0], |
| 1512 } | 1513 } |
| 1513 if xcode_settings.GetPerConfigSetting('SDKROOT', configuration): | 1514 if xcode_settings.GetPerConfigSetting('SDKROOT', configuration): |
| 1514 env['SDKROOT'] = xcode_settings._SdkPath(configuration) | 1515 env['SDKROOT'] = xcode_settings._SdkPath(configuration) |
| 1515 else: | 1516 else: |
| 1516 env['SDKROOT'] = '' | 1517 env['SDKROOT'] = '' |
| 1517 | 1518 |
| 1519 if xcode_settings.mac_toolchain_dir: |
| 1520 env['DEVELOPER_DIR'] = xcode_settings.mac_toolchain_dir |
| 1521 |
| 1518 if spec['type'] in ( | 1522 if spec['type'] in ( |
| 1519 'executable', 'static_library', 'shared_library', 'loadable_module'): | 1523 'executable', 'static_library', 'shared_library', 'loadable_module'): |
| 1520 env['EXECUTABLE_NAME'] = xcode_settings.GetExecutableName() | 1524 env['EXECUTABLE_NAME'] = xcode_settings.GetExecutableName() |
| 1521 env['EXECUTABLE_PATH'] = xcode_settings.GetExecutablePath() | 1525 env['EXECUTABLE_PATH'] = xcode_settings.GetExecutablePath() |
| 1522 env['FULL_PRODUCT_NAME'] = xcode_settings.GetFullProductName() | 1526 env['FULL_PRODUCT_NAME'] = xcode_settings.GetFullProductName() |
| 1523 mach_o_type = xcode_settings.GetMachOType() | 1527 mach_o_type = xcode_settings.GetMachOType() |
| 1524 if mach_o_type: | 1528 if mach_o_type: |
| 1525 env['MACH_O_TYPE'] = mach_o_type | 1529 env['MACH_O_TYPE'] = mach_o_type |
| 1526 env['PRODUCT_TYPE'] = xcode_settings.GetProductType() | 1530 env['PRODUCT_TYPE'] = xcode_settings.GetProductType() |
| 1527 if xcode_settings._IsBundle(): | 1531 if xcode_settings._IsBundle(): |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 if toolset == 'target': | 1668 if toolset == 'target': |
| 1665 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1669 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
| 1666 return targets | 1670 return targets |
| 1667 | 1671 |
| 1668 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1672 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
| 1669 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1673 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
| 1670 targets for iOS device builds.""" | 1674 targets for iOS device builds.""" |
| 1671 if _HasIOSTarget(target_dicts): | 1675 if _HasIOSTarget(target_dicts): |
| 1672 return _AddIOSDeviceConfigurations(target_dicts) | 1676 return _AddIOSDeviceConfigurations(target_dicts) |
| 1673 return target_dicts | 1677 return target_dicts |
| OLD | NEW |