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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1025 else: | 1025 else: |
1026 m = self.library_re.match(library) | 1026 m = self.library_re.match(library) |
1027 if m: | 1027 if m: |
1028 l = '-l' + m.group(1) | 1028 l = '-l' + m.group(1) |
1029 else: | 1029 else: |
1030 l = library | 1030 l = library |
1031 | 1031 |
1032 sdk_root = self._SdkPath(config_name) | 1032 sdk_root = self._SdkPath(config_name) |
1033 if not sdk_root: | 1033 if not sdk_root: |
1034 sdk_root = '' | 1034 sdk_root = '' |
1035 return l.replace('$(SDKROOT)', sdk_root) | 1035 if l.startswith('$(SDKROOT)'): |
1036 library = l.replace('$(SDKROOT)', sdk_root) | |
1037 basename, ext = os.path.splitext(library) | |
1038 if ext == '.dylib' and not os.path.exists(library): | |
1039 tbd_library = basename + '.tbd' | |
1040 if not os.path.exists(library) and os.path.exists(tbd_library): | |
1041 l = os.path.splitext(l)[0] + '.tbd' | |
1042 l = l.replace('$(SDKROOT)', sdk_root) | |
Mark Mentovai
2015/08/10 18:41:44
I don’t like the double-replace of SDKROOT.
sdefresne
2015/08/11 07:42:59
Fixed (with the double os.path.exists(library) too
| |
1043 return l | |
1036 | 1044 |
1037 def AdjustLibraries(self, libraries, config_name=None): | 1045 def AdjustLibraries(self, libraries, config_name=None): |
1038 """Transforms entries like 'Cocoa.framework' in libraries into entries like | 1046 """Transforms entries like 'Cocoa.framework' in libraries into entries like |
1039 '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | 1047 '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. |
1040 """ | 1048 """ |
1041 libraries = [self._AdjustLibrary(library, config_name) | 1049 libraries = [self._AdjustLibrary(library, config_name) |
1042 for library in libraries] | 1050 for library in libraries] |
1043 return libraries | 1051 return libraries |
1044 | 1052 |
1045 def _BuildMachineOSBuild(self): | 1053 def _BuildMachineOSBuild(self): |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1601 if toolset == 'target': | 1609 if toolset == 'target': |
1602 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1610 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
1603 return targets | 1611 return targets |
1604 | 1612 |
1605 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1613 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
1606 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1614 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
1607 targets for iOS device builds.""" | 1615 targets for iOS device builds.""" |
1608 if _HasIOSTarget(target_dicts): | 1616 if _HasIOSTarget(target_dicts): |
1609 return _AddIOSDeviceConfigurations(target_dicts) | 1617 return _AddIOSDeviceConfigurations(target_dicts) |
1610 return target_dicts | 1618 return target_dicts |
OLD | NEW |