mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
19 lines
466 B
Rust
19 lines
466 B
Rust
use std::env;
|
|
use std::ffi::OsString;
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
|
|
let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc"));
|
|
|
|
let output = Command::new(rustc)
|
|
.arg("--version")
|
|
.output()
|
|
.expect("failed to run `rustc --version`");
|
|
|
|
if String::from_utf8_lossy(&output.stdout).contains("nightly") {
|
|
println!("cargo:rustc-cfg=nightly");
|
|
}
|
|
}
|