ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang"
ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++"
+ # macOS 10.15 onwards doesn't have libraries in /usr/include anymore: those
+ # are now located deep into the filesystem, under Xcode's own files. The
+ # native clang is configured to use the correct path, but our custom one
+ # doesn't. This sets the SDKROOT environment variable to the SDK so that
+ # our own clang can figure out the correct include path on its own.
+ if ! [[ -d "/usr/include" ]]; then
+ ciCommandSetEnv SDKROOT "$(xcrun --sdk macosx --show-sdk-path)"
+ fi
+
# Configure `AR` specifically so rustbuild doesn't try to infer it as
# `clang-ar` by accident.
ciCommandSetEnv AR "ar"