use build_target::{Arch, Os};
fn main() {
let version_meta = rustc_version::version_meta().unwrap();
if cfg!(feature = "nightly") && !cfg!(feature = "stable")
|| version_meta.channel == rustc_version::Channel::Nightly
{
cargo_emit::rustc_cfg!("nightly");
}
let t = build_target::target();
if t.arch == Arch::X86 {
cargo_emit::rustc_cfg!("has_abi_cdecl");
cargo_emit::rustc_cfg!("has_abi_stdcall");
cargo_emit::rustc_cfg!("has_abi_fastcall");
}
if t.arch == Arch::X86_64 {
if t.os == Os::Windows {
cargo_emit::rustc_cfg!("has_abi_win64");
} else {
cargo_emit::rustc_cfg!("has_abi_sysv64");
}
}
if t.arch == Arch::Arm {
cargo_emit::rustc_cfg!("has_abi_aapcs");
}
}