Only build clang_rt when RUSTBUILD_FORCE_CLANG_BASED_TESTS is set.

This commit is contained in:
Michael Woerister 2019-05-27 15:09:26 +02:00
parent 48b9896eeb
commit 577ea539dc
3 changed files with 34 additions and 19 deletions

View file

@ -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());