empty build.rs

feed
Avril 4 years ago
parent 460d2b0081
commit 34a62da8ba
Signed by: flanchan
GPG Key ID: 284488987C31F630

1
Cargo.lock generated

@ -630,6 +630,7 @@ dependencies = [
"once_cell", "once_cell",
"pin-project", "pin-project",
"pretty_env_logger", "pretty_env_logger",
"rustc_version",
"serde", "serde",
"serde_cbor", "serde_cbor",
"smallmap", "smallmap",

@ -67,3 +67,6 @@ smallmap = "1.1.5"
lazy_static = "1.4.0" lazy_static = "1.4.0"
once_cell = "1.4.1" once_cell = "1.4.1"
bzip2-sys = {version = "0.1.9", optional = true} bzip2-sys = {version = "0.1.9", optional = true}
[build-dependencies]
rustc_version = "0.2"

@ -0,0 +1,26 @@
extern crate rustc_version;
use rustc_version::{version, version_meta, Channel};
fn main() {
// Assert we haven't travelled back in time
assert!(version().unwrap().major >= 1);
// Set cfg flags depending on release channel
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=dev");
}
}
//println!("cargo:rustc-link-lib=static=bz2"); // TODO: Make this conditional for `compress-chain`
}
Loading…
Cancel
Save