fn main() {
println!("cargo::rustc-check-cfg=cfg(epics_embedded_target)");
println!("cargo::rustc-check-cfg=cfg(asyn_serial_backend)");
println!("cargo::rustc-check-cfg=cfg(asyn_baud_code_is_rate)");
println!("cargo::rustc-check-cfg=cfg(asyn_af_unix)");
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
let target_family = std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap_or_default();
let embedded = matches!(target_os.as_str(), "rtems" | "vxworks");
if embedded {
println!("cargo::rustc-cfg=epics_embedded_target");
}
let unix = target_family.split(',').any(|f| f == "unix");
let windows = target_family.split(',').any(|f| f == "windows");
if unix || windows {
println!("cargo::rustc-cfg=asyn_serial_backend");
}
if matches!(
target_os.as_str(),
"macos" | "ios" | "freebsd" | "netbsd" | "openbsd" | "dragonfly" | "vxworks" | "rtems"
) {
println!("cargo::rustc-cfg=asyn_baud_code_is_rate");
}
if unix && target_os != "vxworks" {
println!("cargo::rustc-cfg=asyn_af_unix");
}
}