1 2 3 4 5 6 7 8 9 10
#[cfg(any(target_os = "freebsd", target_os = "macos"))] extern crate cc; fn main() { // On FreeBSD and macOS, build the sysctl wrapper #[cfg(any(target_os = "freebsd", target_os = "macos"))] cc::Build::new() .file("src/bsd.c") .compile("bsdwrapper"); }