]>
git.proxmox.com Git - rustc.git/blob - vendor/serde_derive/build.rs
2 use std
::process
::Command
;
5 // The rustc-cfg strings below are *not* public API. Please let us know by
6 // opening a GitHub issue if your build environment requires some way to enable
7 // these cfgs other than by executing our build script.
9 let minor
= match rustc_minor_version() {
14 // Underscore const names stabilized in Rust 1.37:
15 // https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html#using-unnamed-const-items-for-macros
17 println
!("cargo:rustc-cfg=underscore_consts");
21 fn rustc_minor_version() -> Option
<u32> {
22 let rustc
= env
::var_os("RUSTC")?
;
23 let output
= Command
::new(rustc
).arg("--version").output().ok()?
;
24 let version
= str::from_utf8(&output
.stdout
).ok()?
;
25 let mut pieces
= version
.split('
.'
);
26 if pieces
.next() != Some("rustc 1") {
29 pieces
.next()?
.parse().ok()