-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.rs
More file actions
19 lines (18 loc) · 710 Bytes
/
build.rs
File metadata and controls
19 lines (18 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#[cfg(not(feature = "docs"))]
fn main() {
println!("cargo::rustc-check-cfg=cfg(CHANNEL_NIGHTLY)");
println!("cargo:rerun-if-changed=build.rs");
}
#[cfg(feature = "docs")]
fn main() {
// for documenting features when using nightly
let channel = match rustc_version::version_meta().unwrap().channel {
rustc_version::Channel::Dev => "CHANNEL_DEV",
rustc_version::Channel::Nightly => "CHANNEL_NIGHTLY",
rustc_version::Channel::Beta => "CHANNEL_BETA",
rustc_version::Channel::Stable => "CHANNEL_STABLE",
};
println!("cargo::rustc-check-cfg=cfg(CHANNEL_NIGHTLY)");
println!("cargo:rustc-cfg={channel}");
println!("cargo:rerun-if-changed=build.rs");
}