use rustc_version::{version_meta, Channel};
fn main() {
#[cfg(feature = "compile_capnp_schema")]
{
capnpc::CompilerCommand::new()
.file(concat!(
env!("CARGO_MANIFEST_DIR"),
"/network/src/message/payload.capnp"
))
.output_path(".")
.run()
.expect("cap'n'proto network schema compilation failed");
}
match version_meta().unwrap().channel {
Channel::Stable => println!("cargo:rustc-cfg=stable"),
Channel::Beta => println!("cargo:rustc-cfg=beta"),
Channel::Nightly => println!("cargo:rustc-cfg=nightly"),
Channel::Dev => println!("cargo:rustc-cfg=rustc_dev"),
}
}