Skip to content

Commit 1f675d3

Browse files
committed
bootstrap: Override CMAKE_OSX_SYSROOT when building compiler-rt
Similarly to what was previously done for the `llvm` step.
1 parent 02ee3ae commit 1f675d3

File tree

1 file changed

+4
-3
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+4
-3
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ impl Step for Llvm {
385385
|| target.contains("apple-watchos")
386386
|| target.contains("apple-visionos")
387387
{
388-
// These two defines prevent CMake from automatically trying to add a MacOSX sysroot, which leads to a compiler error.
389-
cfg.define("CMAKE_OSX_SYSROOT", "/");
390-
cfg.define("CMAKE_OSX_DEPLOYMENT_TARGET", "");
391388
// Prevent cmake from adding -bundle to CFLAGS automatically, which leads to a compiler error because "-bitcode_bundle" also gets added.
392389
cfg.define("LLVM_ENABLE_PLUGINS", "OFF");
393390
// Zlib fails to link properly, leading to a compiler error.
@@ -703,6 +700,10 @@ fn configure_cmake(
703700
//
704701
// So for now we set it to "Darwin" on all Apple platforms.
705702
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
703+
704+
// These two defines prevent CMake from automatically trying to add a MacOSX sysroot, which leads to a compiler error.
705+
cfg.define("CMAKE_OSX_SYSROOT", "/");
706+
cfg.define("CMAKE_OSX_DEPLOYMENT_TARGET", "");
706707
}
707708

708709
// Make sure that CMake does not build universal binaries on macOS.

0 commit comments

Comments
 (0)