Skip to content

Commit 4d7d3e3

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 4d7d3e3

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

+11-4
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, we should be using "tvOS" here.
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, we should be using "visionOS" here.
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, we should be using "watchOS" here.
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)