2021-07-23 20:59:29 +08:00
|
|
|
use std::env;
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{BufRead, BufReader};
|
|
|
|
use std::path::Path;
|
2021-07-21 15:25:37 +08:00
|
|
|
|
|
|
|
fn main() {
|
2021-07-23 20:59:29 +08:00
|
|
|
let out_dir = env::var("BUILDINC_DIRECTORY").unwrap();
|
|
|
|
let cfg_path = Path::new(&out_dir).join("generated").join("rust-cfg");
|
|
|
|
println!("cargo:rerun-if-changed={}", cfg_path.to_str().unwrap());
|
|
|
|
|
|
|
|
let f = BufReader::new(File::open(&cfg_path).unwrap());
|
|
|
|
for line in f.lines() {
|
|
|
|
println!("cargo:rustc-cfg={}", line.unwrap());
|
|
|
|
}
|
2021-07-21 15:25:37 +08:00
|
|
|
}
|