use std::env;
use std::process::Command;
fn main() {
let protoc = protoc_bin_vendored::protoc_bin_path().expect("vendored protoc");
unsafe { env::set_var("PROTOC", &protoc) };
println!("cargo::rerun-if-changed=proto/wire.proto");
prost_build::compile_protos(&["proto/wire.proto"], &["proto/"])
.expect("failed to compile wire.proto");
let output = Command::new("rustc")
.arg("--version")
.output()
.expect("Failed to execute rustc");
let version = String::from_utf8(output.stdout)
.expect("Invalid UTF-8 from rustc")
.trim()
.to_string();
println!("cargo::rerun-if-env-changed=RUSTC");
println!("cargo::rustc-env=RUSTC_VERSION={}", version);
}