use std::env;
fn build_syscalls() {
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let syscall_file = format!("src/syscalls/syscall_{}.c", target_arch);
println!("syscall file: {}", syscall_file);
cc::Build::new().file(syscall_file).compile("syscall");
}
fn main() {
let rustc_toolchain = env::var("RUSTUP_TOOLCHAIN").unwrap_or("stable".to_string());
if rustc_toolchain.starts_with("nightly") {
println!("cargo:rustc-cfg=has_asm");
} else {
build_syscalls();
}
}