use std::env::var;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
let os = var("CARGO_CFG_TARGET_OS").unwrap();
let freebsdlike = os == "freebsd" || os == "dragonfly";
if freebsdlike {
use_feature("freebsdlike");
}
let netbsdlike = os == "openbsd" || os == "netbsd";
if netbsdlike {
use_feature("netbsdlike");
}
let apple = os == "macos" || os == "ios" || os == "tvos" || os == "visionos" || os == "watchos";
if apple {
use_feature("apple");
}
if os == "linux" || os == "l4re" || os == "android" || os == "emscripten" {
use_feature("linux_like");
}
if os == "solaris" || os == "illumos" {
use_feature("solarish");
}
if apple || freebsdlike || netbsdlike {
use_feature("bsd");
}
if os == "android" || os == "linux" {
use_feature("linux_kernel");
}
}
fn use_feature(feature: &str) {
println!("cargo:rustc-cfg={}", feature);
}