about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-12-12 18:13:04 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-12-12 18:13:04 +0100
commitd79e19f3320be33f280a2b2eeb2e1ffd7f8f9162 (patch)
treeb5082f08b8f7c59368a4aa56fae95a67b1122675 /src/bootstrap
parent16f69b5430cd543d5767401d760cc644dc836906 (diff)
downloadrust-d79e19f3320be33f280a2b2eeb2e1ffd7f8f9162.tar.gz
rust-d79e19f3320be33f280a2b2eeb2e1ffd7f8f9162.zip
Don't require cmake and ninja when the LLVM backend is not used
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/sanity.rs36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 4cfcf6ca407..8d7ad345ab4 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -17,6 +17,7 @@ use std::process::Command;
 
 use build_helper::{output, t};
 
+use crate::cache::INTERNER;
 use crate::config::Target;
 use crate::Build;
 
@@ -79,18 +80,19 @@ pub fn check(build: &mut Build) {
     }
 
     // We need cmake, but only if we're actually building LLVM or sanitizers.
-    let building_llvm = build
-        .hosts
-        .iter()
-        .map(|host| {
-            build
-                .config
-                .target_config
-                .get(host)
-                .map(|config| config.llvm_config.is_none())
-                .unwrap_or(true)
-        })
-        .any(|build_llvm_ourselves| build_llvm_ourselves);
+    let building_llvm = build.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm"))
+        && build
+            .hosts
+            .iter()
+            .map(|host| {
+                build
+                    .config
+                    .target_config
+                    .get(host)
+                    .map(|config| config.llvm_config.is_none())
+                    .unwrap_or(true)
+            })
+            .any(|build_llvm_ourselves| build_llvm_ourselves);
     if building_llvm || build.config.any_sanitizers_enabled() {
         cmd_finder.must_have("cmake");
     }
@@ -147,10 +149,12 @@ pub fn check(build: &mut Build) {
         }
     }
 
-    // Externally configured LLVM requires FileCheck to exist
-    let filecheck = build.llvm_filecheck(build.build);
-    if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
-        panic!("FileCheck executable {:?} does not exist", filecheck);
+    if build.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {
+        // Externally configured LLVM requires FileCheck to exist
+        let filecheck = build.llvm_filecheck(build.build);
+        if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
+            panic!("FileCheck executable {:?} does not exist", filecheck);
+        }
     }
 
     for target in &build.targets {