add cfg(nightly) attribute
This commit is contained in:
parent
6ebb4de45b
commit
b0bfbf147a
1 changed files with 15 additions and 0 deletions
15
nixide/build.rs
Normal file
15
nixide/build.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use std::env;
|
||||
|
||||
fn main() {
|
||||
// allow the `cfg(nightly)` attribute
|
||||
println!("cargo::rustc-check-cfg=cfg(nightly)");
|
||||
|
||||
// NOTE: This allows nixide to conditionally compile based
|
||||
// NOTE: whether a user has access to nightly features.
|
||||
if let Ok(toolchain) = env::var("RUSTUP_TOOLCHAIN")
|
||||
&& toolchain.contains("nightly")
|
||||
{
|
||||
// enable the `nightly` flag
|
||||
println!("cargo::rustc-cfg=nightly");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue