fn main() {
let target = std::env::var("TARGET").unwrap_or_default();
if !target.contains("linux") && !target.contains("darwin") && !target.contains("windows") {
panic!(
"vetto builds only on Linux, macOS, and Windows. \
Refusing to produce an unsandboxed or broken build for target {target}."
);
}
println!("cargo:rerun-if-changed=build.rs");
if let Ok(output) = std::process::Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
{
if output.status.success() {
if let Ok(hash) = String::from_utf8(output.stdout) {
let hash = hash.trim();
if !hash.is_empty() {
println!("cargo:rustc-env=VETTO_GIT_HASH={hash}");
}
}
}
}
}