MCPcopy Index your code
hub / github.com/RustPython/RustPython / _default_sysroot

Function _default_sysroot

Lib/_osx_support.py:153–176  ·  view source on GitHub ↗

Returns the root of the default SDK for this system, or '/'

(cc)

Source from the content-addressed store, hash-verified

151
152_cache_default_sysroot = None
153def _default_sysroot(cc):
154 """ Returns the root of the default SDK for this system, or '/' """
155 global _cache_default_sysroot
156
157 if _cache_default_sysroot is not None:
158 return _cache_default_sysroot
159
160 contents = _read_output('%s -c -E -v - </dev/null' % (cc,), True)
161 in_incdirs = False
162 for line in contents.splitlines():
163 if line.startswith("#include <...>"):
164 in_incdirs = True
165 elif line.startswith("End of search list"):
166 in_incdirs = False
167 elif in_incdirs:
168 line = line.strip()
169 if line == '/usr/include':
170 _cache_default_sysroot = '/'
171 elif line.endswith(".sdk/usr/include"):
172 _cache_default_sysroot = line[:-12]
173 if _cache_default_sysroot is None:
174 _cache_default_sysroot = '/'
175
176 return _cache_default_sysroot
177
178def _supports_universal_builds():
179 """Returns True if universal builds are supported on this system"""

Callers

nothing calls this directly

Calls 5

_read_outputFunction · 0.85
splitlinesMethod · 0.45
startswithMethod · 0.45
stripMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected