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