build.rs

Thu, 03 Sep 2026 11:55:09 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 03 Sep 2026 11:55:09 -0500
changeset 209
060891c3f537
parent 94
1f19c6bbf07b
permissions
-rw-r--r--

p2powers_diff maybe fix

94
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1 use rustc_version::{version_meta, Channel};
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
2
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3 fn main() {
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
4 // Tell rust that nightly flag exists
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
5 println!("cargo::rustc-check-cfg=cfg(nightly)");
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
6 if version_meta().unwrap().channel == Channel::Nightly {
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
7 // … and set it for nightly.
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8 println!("cargo:rustc-cfg=nightly");
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 }
1f19c6bbf07b Fix build with stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 }

mercurial