napi-rs/build/src/lib.rs

24 lines
473 B
Rust
Raw Normal View History

mod macos;
2021-04-02 07:32:01 +09:00
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(),
2021-04-02 07:32:01 +09:00
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")
}
}
}
_ => {}
2020-02-18 22:09:17 +09:00
}
}