2016-01-09 22:38:27 +00:00
|
|
|
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
|
2016-01-30 01:51:21 +00:00
|
|
|
index 407ead0..8bf64e7 100644
|
2016-01-09 22:38:27 +00:00
|
|
|
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
|
|
|
|
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
|
|
|
|
@@ -446,10 +446,16 @@ class XcodeSettings(object):
|
2014-01-13 12:48:04 +00:00
|
|
|
|
|
|
|
def _XcodeSdkPath(self, sdk_root):
|
2013-05-28 23:38:16 +01:00
|
|
|
if sdk_root not in XcodeSettings._sdk_path_cache:
|
2014-01-13 12:48:04 +00:00
|
|
|
- sdk_path = self._GetSdkVersionInfoItem(sdk_root, 'Path')
|
|
|
|
- XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
|
|
|
|
- if sdk_root:
|
|
|
|
- XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
|
2014-02-04 17:03:21 +00:00
|
|
|
+ try:
|
|
|
|
+ sdk_path = self._GetSdkVersionInfoItem(sdk_root, 'Path')
|
|
|
|
+ XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
|
|
|
|
+ if sdk_root:
|
|
|
|
+ XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
|
|
|
|
+ except:
|
|
|
|
+ # if this fails it's because xcodebuild failed, which means
|
|
|
|
+ # the user is probably on a CLT-only system, where there
|
|
|
|
+ # is no valid SDK root
|
|
|
|
+ XcodeSettings._sdk_path_cache[sdk_root] = None
|
|
|
|
return XcodeSettings._sdk_path_cache[sdk_root]
|
2013-05-28 23:38:16 +01:00
|
|
|
|
|
|
|
def _AppendPlatformVersionMinFlags(self, lst):
|
2016-01-09 22:38:27 +00:00
|
|
|
@@ -572,10 +578,11 @@ class XcodeSettings(object):
|
2014-02-04 17:03:21 +00:00
|
|
|
framework_root = sdk_root
|
|
|
|
else:
|
|
|
|
framework_root = ''
|
2013-05-28 23:38:16 +01:00
|
|
|
- config = self.spec['configurations'][self.configname]
|
|
|
|
- framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
- for directory in framework_dirs:
|
2014-02-04 17:03:21 +00:00
|
|
|
- cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
|
2013-05-28 23:38:16 +01:00
|
|
|
+ if 'SDKROOT' in self._Settings():
|
|
|
|
+ config = self.spec['configurations'][self.configname]
|
|
|
|
+ framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
+ for directory in framework_dirs:
|
2014-02-04 17:03:21 +00:00
|
|
|
+ cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
|
2013-05-28 23:38:16 +01:00
|
|
|
|
|
|
|
self.configname = None
|
|
|
|
return cflags
|
2016-01-09 22:38:27 +00:00
|
|
|
@@ -826,10 +833,11 @@ class XcodeSettings(object):
|
2014-02-04 17:03:21 +00:00
|
|
|
sdk_root = self._SdkPath()
|
|
|
|
if not sdk_root:
|
|
|
|
sdk_root = ''
|
2013-05-28 23:38:16 +01:00
|
|
|
- config = self.spec['configurations'][self.configname]
|
|
|
|
- framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
- for directory in framework_dirs:
|
2014-02-04 17:03:21 +00:00
|
|
|
- ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
|
2013-05-28 23:38:16 +01:00
|
|
|
+ if 'SDKROOT' in self._Settings():
|
|
|
|
+ config = self.spec['configurations'][self.configname]
|
|
|
|
+ framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
+ for directory in framework_dirs:
|
2014-02-04 17:03:21 +00:00
|
|
|
+ ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
|
2013-05-28 23:38:16 +01:00
|
|
|
|
2016-01-09 22:38:27 +00:00
|
|
|
is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension()
|
|
|
|
if sdk_root and is_extension:
|