diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2019-05-27 15:09:26 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2019-05-27 16:40:00 +0200 |
| commit | 577ea539dc4a264b480404700a2463e657c09c87 (patch) | |
| tree | d0b31b0b265430534d177c8a9ef99d14a3f0110b /src | |
| parent | 48b9896eebff639f794f2a67532c741eb1e3b79f (diff) | |
| download | rust-577ea539dc4a264b480404700a2463e657c09c87.tar.gz rust-577ea539dc4a264b480404700a2463e657c09c87.zip | |
Only build clang_rt when RUSTBUILD_FORCE_CLANG_BASED_TESTS is set.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/native.rs | 16 | ||||
| -rw-r--r-- | src/bootstrap/test.rs | 21 | ||||
| -rw-r--r-- | src/bootstrap/util.rs | 16 |
3 files changed, 34 insertions, 19 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index b89cd4981a7..bf3601cb312 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -203,8 +203,16 @@ impl Step for Llvm { cfg.define("LLVM_BUILD_32_BITS", "ON"); } + let mut enabled_llvm_projects = Vec::new(); + + if util::forcing_clang_based_tests() { + enabled_llvm_projects.push("clang"); + enabled_llvm_projects.push("compiler-rt"); + } + if want_lldb { - cfg.define("LLVM_ENABLE_PROJECTS", "clang;lldb;compiler-rt"); + enabled_llvm_projects.push("clang"); + enabled_llvm_projects.push("lldb"); // For the time being, disable code signing. cfg.define("LLDB_CODESIGN_IDENTITY", ""); cfg.define("LLDB_NO_DEBUGSERVER", "ON"); @@ -214,6 +222,12 @@ impl Step for Llvm { cfg.define("LLVM_ENABLE_LIBXML2", "OFF"); } + if enabled_llvm_projects.len() > 0 { + enabled_llvm_projects.sort(); + enabled_llvm_projects.dedup(); + cfg.define("LLVM_ENABLE_PROJECTS", enabled_llvm_projects.join(";")); + } + if let Some(num_linkers) = builder.config.llvm_link_jobs { if num_linkers > 0 { cfg.define("LLVM_PARALLEL_LINK_JOBS", num_linkers.to_string()); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 05b3ce6bc89..9d0aa09f15c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1143,24 +1143,9 @@ impl Step for Compiletest { } } - if let Some(var) = env::var_os("RUSTBUILD_FORCE_CLANG_BASED_TESTS") { - match &var.to_string_lossy().to_lowercase()[..] { - "1" | "yes" | "on" => { - assert!(builder.config.lldb_enabled, - "RUSTBUILD_FORCE_CLANG_BASED_TESTS needs Clang/LLDB to \ - be built."); - let clang_exe = builder.llvm_out(target).join("bin").join("clang"); - cmd.arg("--run-clang-based-tests-with").arg(clang_exe); - } - "0" | "no" | "off" => { - // Nothing to do. - } - other => { - // Let's make sure typos don't get unnoticed - panic!("Unrecognized option '{}' set in \ - RUSTBUILD_FORCE_CLANG_BASED_TESTS", other); - } - } + if util::forcing_clang_based_tests() { + let clang_exe = builder.llvm_out(target).join("bin").join("clang"); + cmd.arg("--run-clang-based-tests-with").arg(clang_exe); } // Get paths from cmd args diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index f22f0559265..9f684678bb0 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -356,3 +356,19 @@ impl CiEnv { } } } + +pub fn forcing_clang_based_tests() -> bool { + if let Some(var) = env::var_os("RUSTBUILD_FORCE_CLANG_BASED_TESTS") { + match &var.to_string_lossy().to_lowercase()[..] { + "1" | "yes" | "on" => true, + "0" | "no" | "off" => false, + other => { + // Let's make sure typos don't go unnoticed + panic!("Unrecognized option '{}' set in \ + RUSTBUILD_FORCE_CLANG_BASED_TESTS", other) + } + } + } else { + false + } +} |
