use std::process::Command;
const PACK_ABI_REVISION: u32 = 1;
fn main() {
let rustc_version = Command::new(std::env::var_os("RUSTC").unwrap_or_else(|| "rustc".into()))
.arg("-vV")
.output()
.map(|o| String::from_utf8_lossy(&o.stdout).into_owned())
.unwrap_or_else(|_| "unknown-rustc".to_string());
let mut h: u32 = 0x811c9dc5; for b in rustc_version.as_bytes() {
h ^= *b as u32;
h = h.wrapping_mul(0x01000193);
}
for b in PACK_ABI_REVISION.to_le_bytes() {
h ^= b as u32;
h = h.wrapping_mul(0x01000193);
}
let triple = std::env::var("TARGET").unwrap_or_else(|_| "unknown".into());
println!("cargo:rustc-env=REFLOW_PACK_ABI_VERSION={h}");
println!("cargo:rustc-env=REFLOW_PACK_HOST_TRIPLE={triple}");
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=RUSTC");
}