tools: patch gyp to avoid xcrun errors

Previously running ./configure with only the Xcode Command Line Tools
installed would give:

xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation
xcrun: error: unable to lookup item 'PlatformPath' in SDK '/'

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Fixes: https://github.com/nodejs/node/issues/12531

PR-URL: https://github.com/nodejs/node/pull/21520
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ujjwal Sharma 2018-06-25 16:17:16 +05:30
parent fc81e80191
commit 51812ff12b
No known key found for this signature in database
GPG Key ID: 1FD3B47B83F46621

View File

@ -645,8 +645,9 @@ class XcodeSettings(object):
cflags += self._Settings().get('WARNING_CFLAGS', []) cflags += self._Settings().get('WARNING_CFLAGS', [])
if self._IsXCTest():
platform_root = self._XcodePlatformPath(configname) platform_root = self._XcodePlatformPath(configname)
if platform_root and self._IsXCTest(): if platform_root:
cflags.append('-F' + platform_root + '/Developer/Library/Frameworks/') cflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
if sdk_root: if sdk_root:
@ -913,8 +914,9 @@ class XcodeSettings(object):
for directory in framework_dirs: for directory in framework_dirs:
ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root)) ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
if self._IsXCTest():
platform_root = self._XcodePlatformPath(configname) platform_root = self._XcodePlatformPath(configname)
if sdk_root and platform_root and self._IsXCTest(): if sdk_root and platform_root:
ldflags.append('-F' + platform_root + '/Developer/Library/Frameworks/') ldflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
ldflags.append('-framework XCTest') ldflags.append('-framework XCTest')