2013-12-17 11:13:55 +01:00
|
|
|
diff -Naur a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
|
2014-02-04 18:03:21 +01:00
|
|
|
--- a/tools/gyp/pylib/gyp/xcode_emulation.py 2014-01-23 06:05:51.000000000 +0100
|
|
|
|
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py 2014-02-04 17:49:48.000000000 +0100
|
|
|
|
@@ -302,10 +302,17 @@
|
2014-01-13 13:48:04 +01:00
|
|
|
|
|
|
|
def _XcodeSdkPath(self, sdk_root):
|
2013-05-29 00:38:16 +02:00
|
|
|
if sdk_root not in XcodeSettings._sdk_path_cache:
|
2014-01-13 13:48:04 +01: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 18:03:21 +01: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-29 00:38:16 +02:00
|
|
|
|
|
|
|
def _AppendPlatformVersionMinFlags(self, lst):
|
2014-02-04 18:03:21 +01:00
|
|
|
@@ -420,10 +427,12 @@
|
|
|
|
framework_root = sdk_root
|
|
|
|
else:
|
|
|
|
framework_root = ''
|
2013-05-29 00:38:16 +02:00
|
|
|
- config = self.spec['configurations'][self.configname]
|
|
|
|
- framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
- for directory in framework_dirs:
|
2014-02-04 18:03:21 +01:00
|
|
|
- cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
|
|
|
|
+
|
2013-05-29 00:38:16 +02: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 18:03:21 +01:00
|
|
|
+ cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
|
2013-05-29 00:38:16 +02:00
|
|
|
|
|
|
|
self.configname = None
|
|
|
|
return cflags
|
2014-02-04 18:03:21 +01:00
|
|
|
@@ -673,10 +682,12 @@
|
|
|
|
sdk_root = self._SdkPath()
|
|
|
|
if not sdk_root:
|
|
|
|
sdk_root = ''
|
2013-05-29 00:38:16 +02:00
|
|
|
- config = self.spec['configurations'][self.configname]
|
|
|
|
- framework_dirs = config.get('mac_framework_dirs', [])
|
|
|
|
- for directory in framework_dirs:
|
2014-02-04 18:03:21 +01:00
|
|
|
- ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
|
|
|
|
+
|
2013-05-29 00:38:16 +02: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 18:03:21 +01:00
|
|
|
+ ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
|
2013-05-29 00:38:16 +02:00
|
|
|
|
|
|
|
self.configname = None
|
|
|
|
return ldflags
|
2014-02-04 18:03:21 +01:00
|
|
|
@@ -863,7 +874,11 @@
|
|
|
|
sdk_root = self._SdkPath(config_name)
|
|
|
|
if not sdk_root:
|
|
|
|
sdk_root = ''
|
|
|
|
- return l.replace('$(SDKROOT)', sdk_root)
|
|
|
|
+
|
2013-05-29 00:38:16 +02:00
|
|
|
+ if self._SdkPath():
|
2014-02-04 18:03:21 +01:00
|
|
|
+ return l.replace('$(SDKROOT)', sdk_root)
|
2013-05-29 00:38:16 +02:00
|
|
|
+ else:
|
|
|
|
+ return l
|
|
|
|
|
2013-12-17 11:13:55 +01:00
|
|
|
def AdjustLibraries(self, libraries, config_name=None):
|
2013-05-29 00:38:16 +02:00
|
|
|
"""Transforms entries like 'Cocoa.framework' in libraries into entries like
|
2014-02-04 18:03:21 +01:00
|
|
|
@@ -1018,12 +1033,16 @@
|
2014-01-13 13:48:04 +01:00
|
|
|
# Since the value returned by this function is only used when ARCHS is not
|
|
|
|
# set, then on iOS we return "i386", as the default xcode project generator
|
|
|
|
# does not set ARCHS if it is not set in the .gyp file.
|
|
|
|
- if self.isIOS:
|
2014-02-04 18:03:21 +01:00
|
|
|
+
|
2014-01-13 13:48:04 +01:00
|
|
|
+ try:
|
2014-02-04 18:03:21 +01:00
|
|
|
+ if self.isIOS:
|
2014-01-13 13:48:04 +01:00
|
|
|
+ return 'i386'
|
2014-02-04 18:03:21 +01:00
|
|
|
+ version, build = self._XcodeVersion()
|
|
|
|
+ if version >= '0500':
|
2014-01-13 13:48:04 +01:00
|
|
|
+ return 'x86_64'
|
2014-02-04 18:03:21 +01:00
|
|
|
return 'i386'
|
|
|
|
- version, build = self._XcodeVersion()
|
|
|
|
- if version >= '0500':
|
|
|
|
+ except:
|
|
|
|
return 'x86_64'
|
|
|
|
- return 'i386'
|
2014-01-13 13:48:04 +01:00
|
|
|
|
|
|
|
class MacPrefixHeader(object):
|
|
|
|
"""A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature.
|