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 # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of |
| 1036 # ".dylib" without providing a real support for them. What it does, for |
| 1037 # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the |
| 1038 # library order and cause collision when building Chrome. |
| 1039 # |
| 1040 # Instead substitude ".tbd" to ".dylib" in the generated project when the |
| 1041 # following conditions are both true: |
| 1042 # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", |
| 1043 # - the ".dylib" file does not exists but a ".tbd" file do. |
| 1044 library = l.replace('$(SDKROOT)', sdk_root) |
| 1045 if l.startswith('$(SDKROOT)'): |
| 1046 basename, ext = os.path.splitext(library) |
| 1047 if ext == '.dylib' and not os.path.exists(library): |
| 1048 tbd_library = basename + '.tbd' |
| 1049 if os.path.exists(tbd_library): |
| 1050 library = tbd_library |
| 1051 return library |
1036 | 1052 |
1037 def AdjustLibraries(self, libraries, config_name=None): | 1053 def AdjustLibraries(self, libraries, config_name=None): |
1038 """Transforms entries like 'Cocoa.framework' in libraries into entries like | 1054 """Transforms entries like 'Cocoa.framework' in libraries into entries like |
1039 '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | 1055 '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. |
1040 """ | 1056 """ |
1041 libraries = [self._AdjustLibrary(library, config_name) | 1057 libraries = [self._AdjustLibrary(library, config_name) |
1042 for library in libraries] | 1058 for library in libraries] |
1043 return libraries | 1059 return libraries |
1044 | 1060 |
1045 def _BuildMachineOSBuild(self): | 1061 def _BuildMachineOSBuild(self): |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 if toolset == 'target': | 1617 if toolset == 'target': |
1602 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1618 iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
1603 return targets | 1619 return targets |
1604 | 1620 |
1605 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1621 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
1606 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1622 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
1607 targets for iOS device builds.""" | 1623 targets for iOS device builds.""" |
1608 if _HasIOSTarget(target_dicts): | 1624 if _HasIOSTarget(target_dicts): |
1609 return _AddIOSDeviceConfigurations(target_dicts) | 1625 return _AddIOSDeviceConfigurations(target_dicts) |
1610 return target_dicts | 1626 return target_dicts |
OLD | NEW |