about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-05-18 19:35:46 +0200
committerGitHub <noreply@github.com>2021-05-18 19:35:46 +0200
commitaef6848cba1d710704caabc26d451fa8e3535dfc (patch)
tree8814e3bd8389556a4ff1f050582d6abd5b4de914 /src
parent6e05a71bf7acc08155bac8b4c495eee8dc5c8201 (diff)
parent28c9c04325819662219340b21be55daf1d22ae4d (diff)
downloadrust-aef6848cba1d710704caabc26d451fa8e3535dfc.tar.gz
rust-aef6848cba1d710704caabc26d451fa8e3535dfc.zip
Rollup merge of #85423 - jyn514:cmake, r=Mark-Simulacrum
Don't require cmake on Windows when LLVM isn't being built

Previously, setting `download-ci-llvm = true` when cmake wasn't
installed would give the following error:

```
failed to execute command: "cmake" "--help"
error: The system cannot find the file specified. (os error 2)
```
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/sanity.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index ed0cbdf97b0..a28762ac485 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -93,7 +93,8 @@ pub fn check(build: &mut Build) {
                     .unwrap_or(true)
             })
             .any(|build_llvm_ourselves| build_llvm_ourselves);
-    if building_llvm || build.config.any_sanitizers_enabled() {
+    let need_cmake = building_llvm || build.config.any_sanitizers_enabled();
+    if need_cmake {
         cmd_finder.must_have("cmake");
     }
 
@@ -204,7 +205,7 @@ pub fn check(build: &mut Build) {
             }
         }
 
-        if target.contains("msvc") {
+        if need_cmake && target.contains("msvc") {
             // There are three builds of cmake on windows: MSVC, MinGW, and
             // Cygwin. The Cygwin build does not have generators for Visual
             // Studio, so detect that here and error.