File: build.rs

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

pub fn main() {
    let version = version_meta().unwrap();
    let channel = match version.channel {
        Channel::Dev | Channel::Nightly => "unstable",
        Channel::Beta | Channel::Stable => "stable",
    };
    println!("cargo:rustc-cfg=extprim_channel=\"{}\"", channel);
    if version.semver >= Version::new(1, 26, 0) {
        println!("cargo:rustc-cfg=extprim_has_stable_i128");
    }
}