Skip to content

Commit 0151486

Browse files
ryzokukentargos
authored andcommitted
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 <[email protected]> Fixes: #12531 PR-URL: #21520 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b520216 commit 0151486

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tools/gyp/pylib/gyp/xcode_emulation.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,10 @@ def GetCflags(self, configname, arch=None):
645645

646646
cflags += self._Settings().get('WARNING_CFLAGS', [])
647647

648-
platform_root = self._XcodePlatformPath(configname)
649-
if platform_root and self._IsXCTest():
650-
cflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
648+
if self._IsXCTest():
649+
platform_root = self._XcodePlatformPath(configname)
650+
if platform_root:
651+
cflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
651652

652653
if sdk_root:
653654
framework_root = sdk_root
@@ -913,10 +914,11 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
913914
for directory in framework_dirs:
914915
ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
915916

916-
platform_root = self._XcodePlatformPath(configname)
917-
if sdk_root and platform_root and self._IsXCTest():
918-
ldflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
919-
ldflags.append('-framework XCTest')
917+
if self._IsXCTest():
918+
platform_root = self._XcodePlatformPath(configname)
919+
if sdk_root and platform_root:
920+
ldflags.append('-F' + platform_root + '/Developer/Library/Frameworks/')
921+
ldflags.append('-framework XCTest')
920922

921923
is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension()
922924
if sdk_root and is_extension:

0 commit comments

Comments
 (0)