Skip to content

Commit 0f4b1f9

Browse files
committed
bootstrap: Set CMAKE_SYSTEM_NAME=Darwin on Apple platforms
compiler-rt's CMake setup seems to have special logic for Apple platforms that works poorly when this is not set.
1 parent 38602d8 commit 0f4b1f9

File tree

1 file changed

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

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,20 @@ fn configure_cmake(
702702
// macOS
703703
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
704704
} else if target.contains("ios") {
705-
cfg.define("CMAKE_SYSTEM_NAME", "iOS");
705+
// FIXME(madsmtm): compiler-rt's CMake setup is kinda weird, it seems like they do
706+
// version testing etc. for macOS (i.e. Darwin), even while building for iOS?
707+
//
708+
// So for now we set it to "Darwin", but ideally this should be set to "iOS".
709+
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
706710
} else if target.contains("tvos") {
707-
cfg.define("CMAKE_SYSTEM_NAME", "tvOS");
711+
// FIXME(madsmtm): See above.
712+
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
708713
} else if target.contains("visionos") {
709-
cfg.define("CMAKE_SYSTEM_NAME", "visionOS");
714+
// FIXME(madsmtm): See above.
715+
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
710716
} else if target.contains("watchos") {
711-
cfg.define("CMAKE_SYSTEM_NAME", "watchOS");
717+
// FIXME(madsmtm): See above.
718+
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
712719
} else if target.contains("none") {
713720
// "none" should be the last branch
714721
cfg.define("CMAKE_SYSTEM_NAME", "Generic");

0 commit comments

Comments
 (0)