mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:00:12 +01:00
The SDK returned by `xcrun --show-sdk-path` does not always match the SDK that is used by clang under homebrew, because homebrew has its own configurations per target that specify an SDK path to `-isysroot`. And on Darwin, the `-isysroot` flag supercedes the `--sysroot` flag entirely when present. To override homebrew, and ensure we use the SDK we expect to be using from `xcrun`, specify `-isysroot` ourselves on the command line, both when finding the include paths and when building. The compiler ends up taking a dependency on a JSON file at the root of the SDK as well, so add that to our allowlist of non-hermetic files, along-side the SDK include paths.