napi-rs/build/src/lib.rs
2021-04-01 23:32:01 +01:00

23 lines
473 B
Rust

mod macos;
cfg_if::cfg_if! {
if #[cfg(not(target_env = "musl"))] {
mod windows;
}
}
pub fn setup() {
match std::env::var("CARGO_CFG_TARGET_OS").as_deref() {
Ok("macos") => macos::setup(),
Ok("windows") => {
cfg_if::cfg_if! {
if #[cfg(not(target_env = "musl"))] {
windows::setup()
} else {
eprintln!("Cross compiling to windows-msvc is not supported from *-musl hosts")
}
}
}
_ => {}
}
}