Add build warning only if CRANELIFT_VERBOSE is set to anything;

This commit is contained in:
Benjamin Bouvier
2018-11-20 15:40:39 +01:00
committed by Dan Gohman
parent 9947c315b7
commit d15e56a9fa

View File

@@ -23,8 +23,11 @@ extern crate cranelift_codegen_meta as meta;
use meta::isa::Isa;
use std::env;
use std::process;
use std::time::Instant;
fn main() {
let start_time = Instant::now();
let out_dir = env::var("OUT_DIR").expect("The OUT_DIR environment variable must be set");
let target_triple = env::var("TARGET").expect("The TARGET environment variable must be set");
let cranelift_targets = env::var("CRANELIFT_TARGETS").ok();
@@ -92,6 +95,14 @@ fn main() {
process::exit(1);
}
}
if let Ok(_) = env::var("CRANELIFT_VERBOSE") {
println!(
"cargo:warning=Build step took {:?}.",
Instant::now() - start_time
);
println!("cargo:warning=Generated files are in {}", out_dir);
}
}
fn identify_python() -> &'static str {