Skip to content

Commit 998fd94

Browse files
authored
Rollup merge of #113996 - inferiorhumanorgans:dragonfly-cmake-system-name, r=ozkanonur
Define CMAKE_SYSTEM_NAME on a cross build targeting DragonFly. Without `CMAKE_SYSTEM_NAME` set to the target a cross compile will generally fail. Related to #109170.
2 parents d35cf49 + a0538db commit 998fd94

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/bootstrap/download-ci-llvm-stamp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Change this file to make users of the `download-ci-llvm` configuration download
22
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.
33

4-
Last change is for: https://github.com/rust-lang/rust/pull/112931
4+
Last change is for: https://github.com/rust-lang/rust/pull/113996

src/bootstrap/llvm.rs

+7
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ fn configure_cmake(
559559

560560
if target.contains("netbsd") {
561561
cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
562+
} else if target.contains("dragonfly") {
563+
cfg.define("CMAKE_SYSTEM_NAME", "DragonFly");
562564
} else if target.contains("freebsd") {
563565
cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
564566
} else if target.contains("windows") {
@@ -569,7 +571,12 @@ fn configure_cmake(
569571
cfg.define("CMAKE_SYSTEM_NAME", "SunOS");
570572
} else if target.contains("linux") {
571573
cfg.define("CMAKE_SYSTEM_NAME", "Linux");
574+
} else {
575+
builder.info(
576+
"could not determine CMAKE_SYSTEM_NAME from the target `{target}`, build may fail",
577+
);
572578
}
579+
573580
// When cross-compiling we should also set CMAKE_SYSTEM_VERSION, but in
574581
// that case like CMake we cannot easily determine system version either.
575582
//

0 commit comments

Comments
 (0)