MCPcopy Index your code
hub / github.com/nodejs/node / _DefaultSdkRoot

Method _DefaultSdkRoot

tools/gyp/pylib/gyp/xcode_emulation.py:1339–1364  ·  view source on GitHub ↗

Returns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed.

(self)

Source from the content-addressed store, hash-verified

1337 return items
1338
1339 def _DefaultSdkRoot(self):
1340 """Returns the default SDKROOT to use.
1341
1342 Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode
1343 project, then the environment variable was empty. Starting with this
1344 version, Xcode uses the name of the newest SDK installed.
1345 """
1346 xcode_version, _ = XcodeVersion()
1347 if xcode_version < "0500":
1348 return ""
1349 default_sdk_path = self._XcodeSdkPath("")
1350 if default_sdk_root := XcodeSettings._sdk_root_cache.get(default_sdk_path):
1351 return default_sdk_root
1352 try:
1353 all_sdks = GetStdout(["xcodebuild", "-showsdks"])
1354 except (GypError, OSError):
1355 # If xcodebuild fails, there will be no valid SDKs
1356 return ""
1357 for line in all_sdks.splitlines():
1358 items = line.split()
1359 if len(items) >= 3 and items[-2] == "-sdk":
1360 sdk_root = items[-1]
1361 sdk_path = self._XcodeSdkPath(sdk_root)
1362 if sdk_path == default_sdk_path:
1363 return sdk_root
1364 return ""
1365
1366
1367class MacPrefixHeader:

Callers 1

GetExtraPlistItemsMethod · 0.95

Calls 6

_XcodeSdkPathMethod · 0.95
XcodeVersionFunction · 0.85
GetStdoutFunction · 0.85
getMethod · 0.65
splitlinesMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected