Skip to content

Commit

Permalink
Rollup merge of rust-lang#113996 - inferiorhumanorgans:dragonfly-cmak…
Browse files Browse the repository at this point in the history
…e-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 rust-lang#109170.
  • Loading branch information
matthiaskrgr authored Jul 26, 2023
2 parents d35cf49 + a0538db commit 998fd94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/download-ci-llvm-stamp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Change this file to make users of the `download-ci-llvm` configuration download
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.

Last change is for: https://github.com/rust-lang/rust/pull/112931
Last change is for: https://github.com/rust-lang/rust/pull/113996
7 changes: 7 additions & 0 deletions src/bootstrap/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ fn configure_cmake(

if target.contains("netbsd") {
cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
} else if target.contains("dragonfly") {
cfg.define("CMAKE_SYSTEM_NAME", "DragonFly");
} else if target.contains("freebsd") {
cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
} else if target.contains("windows") {
Expand All @@ -569,7 +571,12 @@ fn configure_cmake(
cfg.define("CMAKE_SYSTEM_NAME", "SunOS");
} else if target.contains("linux") {
cfg.define("CMAKE_SYSTEM_NAME", "Linux");
} else {
builder.info(
"could not determine CMAKE_SYSTEM_NAME from the target `{target}`, build may fail",
);
}

// When cross-compiling we should also set CMAKE_SYSTEM_VERSION, but in
// that case like CMake we cannot easily determine system version either.
//
Expand Down

0 comments on commit 998fd94

Please sign in to comment.