2022-03-19 16:26:59 +01:00
|
|
|
use std::{
|
|
|
|
env,
|
|
|
|
fs::File,
|
|
|
|
io::{BufWriter, Write},
|
|
|
|
path::Path,
|
|
|
|
};
|
|
|
|
|
2021-07-27 17:07:28 +02:00
|
|
|
extern crate napi_build;
|
|
|
|
|
|
|
|
fn main() {
|
2022-03-19 16:26:59 +01:00
|
|
|
let out_dir = env::var("OUT_DIR").expect("Outdir should exist");
|
|
|
|
let dest_path = Path::new(&out_dir).join("triple.txt");
|
|
|
|
let mut f =
|
|
|
|
BufWriter::new(File::create(&dest_path).expect("Failed to create target triple text"));
|
|
|
|
write!(
|
|
|
|
f,
|
|
|
|
"{}",
|
|
|
|
env::var("TARGET").expect("Target should be specified")
|
|
|
|
)
|
|
|
|
.expect("Failed to write target triple text");
|
|
|
|
|
2022-02-21 10:24:49 +01:00
|
|
|
napi_build::setup();
|
2021-07-27 17:07:28 +02:00
|
|
|
}
|