napi-rs/crates/napi/build.rs
LongYinan 1fe6ad0430
feat(napi): tokio multi-thread mode on wasi (#2501)
* feat(napi): tokio multi-thread mode on wasi

* tokio_unstable flag

* snapshot

* ensure runtime

* oncelock combine lazylock

* noop feature
2025-03-13 23:53:19 +08:00

9 lines
286 B
Rust

fn main() {
println!("cargo::rustc-check-cfg=cfg(tokio_unstable)");
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
if target_os == "windows" && target_env == "gnu" {
napi_build::setup();
}
}