bootstrap: Override CMAKE_OSX_SYSROOT when building compiler-rt

Similarly to what was previously done for the `llvm` step.
This commit is contained in:
Mads Marquart 2025-03-24 22:58:39 +01:00
parent e8704e899c
commit 011eabd690

View file

@ -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.