From 9d0627d0081a7516902efe108aa07e8f224e5db5 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 16 Mar 2024 17:51:51 +0900 Subject: [PATCH] Fix: Fix it tries to use wasm_bindgen in wasm32-unknown-emscripten environment --- Cargo.toml | 4 ++-- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b2c3f1..a42f257 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,11 +27,11 @@ core-foundation-sys = "0.8.3" [target.'cfg(target_os = "windows")'.dependencies] windows-core = { version = ">=0.50, <=0.52" } -[target.'cfg(target_arch = "wasm32")'.dependencies] +[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] js-sys = "0.3.50" wasm-bindgen = "0.2.70" -[target.'cfg(target_arch = "wasm32")'.dev-dependencies] +[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies] wasm-bindgen-test = "0.3" [target.'cfg(target_os = "haiku")'.dependencies] diff --git a/src/lib.rs b/src/lib.rs index 96fb4dc..8b3fa30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,7 @@ mod ffi_utils; #[cfg_attr(target_os = "windows", path = "tz_windows.rs")] #[cfg_attr(any(target_os = "macos", target_os = "ios"), path = "tz_macos.rs")] #[cfg_attr( - all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_arch = "wasm32", target_os = "unknown"), path = "tz_wasm32.rs" )] #[cfg_attr(