···
1
+
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
2
+
+++ a/tools/gyp/pylib/gyp/xcode_emulation.py
3
+
@@ -473,10 +473,16 @@
5
+
def _XcodeSdkPath(self, sdk_root):
6
+
if sdk_root not in XcodeSettings._sdk_path_cache:
7
+
- sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
8
+
- XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
10
+
- XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
12
+
+ sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
13
+
+ XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
15
+
+ XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
17
+
+ # if this fails it's because xcodebuild failed, which means
18
+
+ # the user is probably on a CLT-only system, where there
19
+
+ # is no valid SDK root
20
+
+ XcodeSettings._sdk_path_cache[sdk_root] = None
21
+
return XcodeSettings._sdk_path_cache[sdk_root]
23
+
def _AppendPlatformVersionMinFlags(self, lst):
24
+
@@ -606,10 +612,11 @@
25
+
framework_root = sdk_root
28
+
- config = self.spec['configurations'][self.configname]
29
+
- framework_dirs = config.get('mac_framework_dirs', [])
30
+
- for directory in framework_dirs:
31
+
- cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
32
+
+ if 'SDKROOT' in self._Settings():
33
+
+ config = self.spec['configurations'][self.configname]
34
+
+ framework_dirs = config.get('mac_framework_dirs', [])
35
+
+ for directory in framework_dirs:
36
+
+ cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
38
+
self.configname = None
40
+
@@ -861,10 +868,11 @@
41
+
sdk_root = self._SdkPath()
44
+
- config = self.spec['configurations'][self.configname]
45
+
- framework_dirs = config.get('mac_framework_dirs', [])
46
+
- for directory in framework_dirs:
47
+
- ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
48
+
+ if 'SDKROOT' in self._Settings():
49
+
+ config = self.spec['configurations'][self.configname]
50
+
+ framework_dirs = config.get('mac_framework_dirs', [])
51
+
+ for directory in framework_dirs:
52
+
+ ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
54
+
platform_root = self._XcodePlatformPath(configname)
55
+
if sdk_root and platform_root and self._IsXCTest():
56
+
@@ -1358,7 +1366,7 @@
58
+
version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
60
+
- raise GypError("No Xcode or CLT version detected!")
62
+
# The CLT has no build information, so we return an empty string.
63
+
version_list = [version, '']
64
+
version = version_list[0]