Returns the root of the default SDK for this system, or '/'
(cc)
| 151 | |
| 152 | _cache_default_sysroot = None |
| 153 | def _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 | |
| 178 | def _supports_universal_builds(): |
| 179 | """Returns True if universal builds are supported on this system""" |
nothing calls this directly
no test coverage detected