zilch/lang/rust/cfg-fetch.rs

10 lines
290 B
Rust

use std::{env::var_os, fs::{create_dir, File}, os::unix::process::CommandExt, process::Command};
fn main() {
Err(
Command::new(var_os("rustc").unwrap())
.arg("--print=cfg")
.stdout(File::create(var_os("out").unwrap()).unwrap())
.exec())
.unwrap()
}