Skip to content

Commit

Permalink
Upgrade cmake to v0.1.50
Browse files Browse the repository at this point in the history
This is the latest version. Now that the cc crate has been successfully
upgraded, we should upgrade cmake as well, as v0.1.48 is now over 2
years old.

cmake v1.0.49 requires CMAKE_SYSTEM_NAME to be set when cross-compiling,
so ensure that we do this for supported Apple OSes.
  • Loading branch information
jfgoog committed May 9, 2024
1 parent faefc61 commit 4742482
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bootstrap/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"

[[package]]
name = "cmake"
version = "0.1.48"
version = "0.1.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a"
checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130"
dependencies = [
"cc",
]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test = false
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);
# otherwise, some targets will fail. That's why these dependencies are explicitly pinned.
cc = "=1.0.97"
cmake = "=0.1.48"
cmake = "=0.1.50"

build_helper = { path = "../tools/build_helper" }
clap = { version = "4.4", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] }
Expand Down
10 changes: 10 additions & 0 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,16 @@ fn configure_cmake(
cfg.define("CMAKE_SYSTEM_NAME", "SunOS");
} else if target.contains("linux") {
cfg.define("CMAKE_SYSTEM_NAME", "Linux");
} else if target.contains("darwin") {
cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
} else if target.contains("ios") {
cfg.define("CMAKE_SYSTEM_NAME", "iOS");
} else if target.contains("tvos") {
cfg.define("CMAKE_SYSTEM_NAME", "tvOS");
} else if target.contains("watchos") {
cfg.define("CMAKE_SYSTEM_NAME", "watchOS");
} else if target.contains("visionos") {
cfg.define("CMAKE_SYSTEM_NAME", "visionOS");
} else {
builder.info(&format!(
"could not determine CMAKE_SYSTEM_NAME from the target `{target}`, build may fail",
Expand Down

0 comments on commit 4742482

Please sign in to comment.