Find FileCheck using llvm-config
This commit is contained in:
parent
94ae2a2e67
commit
73877a0bc8
2 changed files with 3 additions and 2 deletions
|
@ -721,7 +721,8 @@ impl Build {
|
||||||
fn llvm_filecheck(&self, target: &str) -> PathBuf {
|
fn llvm_filecheck(&self, target: &str) -> PathBuf {
|
||||||
let target_config = self.config.target_config.get(target);
|
let target_config = self.config.target_config.get(target);
|
||||||
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
|
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
|
||||||
s.parent().unwrap().join(exe("FileCheck", target))
|
let llvm_bindir = output(Command::new(s).arg("--bindir"));
|
||||||
|
Path::new(llvm_bindir.trim()).join(exe("FileCheck", target))
|
||||||
} else {
|
} else {
|
||||||
let base = self.llvm_out(&self.config.build).join("build");
|
let base = self.llvm_out(&self.config.build).join("build");
|
||||||
let exe = exe("FileCheck", target);
|
let exe = exe("FileCheck", target);
|
||||||
|
|
|
@ -143,7 +143,7 @@ pub fn check(build: &mut Build) {
|
||||||
// Externally configured LLVM requires FileCheck to exist
|
// Externally configured LLVM requires FileCheck to exist
|
||||||
let filecheck = build.llvm_filecheck(&build.config.build);
|
let filecheck = build.llvm_filecheck(&build.config.build);
|
||||||
if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
|
if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
|
||||||
panic!("filecheck executable {:?} does not exist", filecheck);
|
panic!("FileCheck executable {:?} does not exist", filecheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
for target in build.config.target.iter() {
|
for target in build.config.target.iter() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue