Don't try to use ureq on musl targets
This commit is contained in:
parent
03e6048dc9
commit
74e6cf2916
2 changed files with 18 additions and 2 deletions
|
@ -10,4 +10,7 @@ repository = "https://github.com/napi-rs/napi-rs"
|
|||
version = "1.0.1"
|
||||
|
||||
[dependencies]
|
||||
cfg-if = "1"
|
||||
|
||||
[target.'cfg(not(target_env = "musl"))'.dependencies]
|
||||
ureq = "2"
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
mod macos;
|
||||
mod windows;
|
||||
|
||||
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") => windows::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")
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue