Remove references to any SDKs not available
(_config_vars)
| 330 | |
| 331 | |
| 332 | def _check_for_unavailable_sdk(_config_vars): |
| 333 | """Remove references to any SDKs not available""" |
| 334 | # If we're on OSX 10.5 or later and the user tries to |
| 335 | # compile an extension using an SDK that is not present |
| 336 | # on the current machine it is better to not use an SDK |
| 337 | # than to fail. This is particularly important with |
| 338 | # the standalone Command Line Tools alternative to a |
| 339 | # full-blown Xcode install since the CLT packages do not |
| 340 | # provide SDKs. If the SDK is not present, it is assumed |
| 341 | # that the header files and dev libs have been installed |
| 342 | # to /usr and /System/Library by either a standalone CLT |
| 343 | # package or the CLT component within Xcode. |
| 344 | cflags = _config_vars.get('CFLAGS', '') |
| 345 | m = re.search(r'-isysroot\s*(\S+)', cflags) |
| 346 | if m is not None: |
| 347 | sdk = m.group(1) |
| 348 | if not os.path.exists(sdk): |
| 349 | for cv in _UNIVERSAL_CONFIG_VARS: |
| 350 | # Do not alter a config var explicitly overridden by env var |
| 351 | if cv in _config_vars and cv not in os.environ: |
| 352 | flags = _config_vars[cv] |
| 353 | flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags) |
| 354 | _save_modified_value(_config_vars, cv, flags) |
| 355 | |
| 356 | return _config_vars |
| 357 | |
| 358 | |
| 359 | def compiler_fixup(compiler_so, cc_args): |
no test coverage detected
searching dependent graphs…