interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / quote / build.rs

32 lines · 882 bytes Raw Blame History
1use std::env;
2use std::process::Command;
3use std::str;
4
5fn main() {
6 println!("cargo:rerun-if-changed=build.rs");
7
8 let Some(minor) = rustc_minor_version() else {
9 return;
10 };
11
12 if minor >= 77 {
13 println!("cargo:rustc-check-cfg=cfg(no_diagnostic_namespace)");
14 }
15
16 // Support for the `#[diagnostic]` tool attribute namespace
17 // https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#diagnostic-attributes
18 if minor < 78 {
19 println!("cargo:rustc-cfg=no_diagnostic_namespace");
20 }
21}
22
23fn rustc_minor_version() -> Option<u32> {
24 let rustc = env::var_os("RUSTC")?;
25 let output = Command::new(rustc).arg("--version").output().ok()?;
26 let version = str::from_utf8(&output.stdout).ok()?;
27 let mut pieces = version.split('.');
28 if pieces.next() != Some("rustc 1") {
29 return None;
30 }
31 pieces.next()?.parse().ok()
32}