From 474248289f914f3d144c79e1db5a620bf49b210e Mon Sep 17 00:00:00 2001 From: James Farrell Date: Wed, 8 May 2024 14:54:17 +0000 Subject: [PATCH] Upgrade cmake to v0.1.50 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. --- src/bootstrap/Cargo.lock | 4 ++-- src/bootstrap/Cargo.toml | 2 +- src/bootstrap/src/core/build_steps/llvm.rs | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index 4a5d768961ff9..460f982361c46 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -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", ] diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index ca0d1fa5bd0c0..a750bf7fbc378 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -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"] } diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 3af1a05caa829..90ed05861f76e 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -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",