rust/build.rs

25 lines
601 B
Rust
Raw Normal View History

2018-09-16 08:06:05 -05:00
extern crate vergen;
use std::env;
fn main() {
// Forward the profile to the main compilation
println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap());
2017-08-09 11:05:34 -05:00
// Don't rebuild miri even if nothing changed
println!("cargo:rerun-if-changed=build.rs");
2018-09-16 08:06:05 -05:00
// vergen
vergen().expect("Unable to generate vergen constants!");
}
fn vergen() -> vergen::Result<()> {
use vergen::{ConstantsFlags, Vergen};
let vergen = Vergen::new(ConstantsFlags::all())?;
for (k, v) in vergen.build_info() {
println!("cargo:rustc-env={}={}", k.name(), v);
}
Ok(())
}