File: build.rs

package info (click to toggle)
rust-extprim 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 500 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate rustc_version;
extern crate semver;
use rustc_version::{version, version_meta, Channel, Version};

pub fn main() {
    let channel = match version_meta().unwrap().channel {
        Channel::Dev | Channel::Nightly => "unstable",
        Channel::Beta | Channel::Stable => "stable",
    };

    println!("cargo:rustc-cfg=extprim_channel=\"{}\"", channel);
    if version().unwrap() >= Version::parse("1.26.0").unwrap() {
        println!("cargo:rustc-cfg=extprim_has_stable_i128");
    }
}