26 lines
634 B
Rust
26 lines
634 B
Rust
use std::{env, path::Path};
|
|
|
|
use syscall_generator::{
|
|
abi::{ty::TypeWidth, AbiBuilder},
|
|
parse::UnwrapFancy,
|
|
TargetEnv,
|
|
};
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed={}", "syscall.abi");
|
|
let output_dir = env::var("OUT_DIR").unwrap();
|
|
let output = Path::new(&output_dir);
|
|
|
|
let abi = AbiBuilder::from_file(
|
|
"syscall.abi",
|
|
TargetEnv {
|
|
thin_pointer_width: TypeWidth::U64,
|
|
fat_pointer_width: TypeWidth::U128,
|
|
},
|
|
)
|
|
.unwrap_fancy("syscall.abi");
|
|
|
|
abi.write(output.join("generated_abi.rs"))
|
|
.expect("Could not write the generated ABI file");
|
|
}
|