From 011eabd6909e7ba2d6b0fd812658e16d17a38961 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 24 Mar 2025 22:58:39 +0100 Subject: [PATCH] bootstrap: Override CMAKE_OSX_SYSROOT when building compiler-rt Similarly to what was previously done for the `llvm` step. --- src/bootstrap/src/core/build_steps/llvm.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index de91b5d1eb5..e21804fa3c0 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -385,9 +385,6 @@ impl Step for Llvm { || target.contains("apple-watchos") || target.contains("apple-visionos") { - // These two defines prevent CMake from automatically trying to add a MacOSX sysroot, which leads to a compiler error. - cfg.define("CMAKE_OSX_SYSROOT", "/"); - cfg.define("CMAKE_OSX_DEPLOYMENT_TARGET", ""); // Prevent cmake from adding -bundle to CFLAGS automatically, which leads to a compiler error because "-bitcode_bundle" also gets added. cfg.define("LLVM_ENABLE_PLUGINS", "OFF"); // Zlib fails to link properly, leading to a compiler error. @@ -703,6 +700,10 @@ fn configure_cmake( // // So for now we set it to "Darwin" on all Apple platforms. cfg.define("CMAKE_SYSTEM_NAME", "Darwin"); + + // These two defines prevent CMake from automatically trying to add a MacOSX sysroot, which leads to a compiler error. + cfg.define("CMAKE_OSX_SYSROOT", "/"); + cfg.define("CMAKE_OSX_DEPLOYMENT_TARGET", ""); } // Make sure that CMake does not build universal binaries on macOS.