]> git.lizzy.rs Git - rust.git/blobdiff - src/ci/scripts/install-clang.sh
Make drop-glue take advantage of -Zshare-generics.
[rust.git] / src / ci / scripts / install-clang.sh
index f0179994e8e4cb5c44d2c0feea09793c487dd0fe..e16a4814197b31159b53040c4c950b59d222cf18 100755 (executable)
@@ -14,6 +14,15 @@ if isMacOS; then
     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"