(zilch lang rust cargo): parse cfg values at runtime
This commit is contained in:
parent
9f23179d46
commit
054b320f27
3 changed files with 34 additions and 37 deletions
10
lang/rust/cfg-fetch.rs
Normal file
10
lang/rust/cfg-fetch.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue