diff --git a/.cargo/config.toml b/.cargo/config.toml index 35049cbc..31f554bb 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,5 @@ [alias] xtask = "run --package xtask --" + +[target.wasm32-unknown-unknown] +rustflags = ['--cfg', 'getrandom_backend="wasm_js"'] diff --git a/Cargo.lock b/Cargo.lock index 9a3f96ed..7f4aa264 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2833,6 +2833,7 @@ dependencies = [ "futures-channel", "futures-util", "getrandom 0.2.16", + "getrandom 0.3.3", "gloo-net", "gloo-timers", "iron-remote-desktop", diff --git a/crates/ironrdp-web/Cargo.toml b/crates/ironrdp-web/Cargo.toml index 286001a0..56ce9f8b 100644 --- a/crates/ironrdp-web/Cargo.toml +++ b/crates/ironrdp-web/Cargo.toml @@ -56,7 +56,8 @@ resize = { version = "0.8", features = ["std"], default-features = false } rgb = "0.8" # Enable WebAssembly support for a few crates -getrandom = { version = "0.2", features = ["js"] } +getrandom2 = { package = "getrandom", version = "0.2", features = ["js"] } +getrandom = { version = "0.3", features = ["wasm_js"] } chrono = { version = "0.4", features = ["wasmbind"] } time = { version = "0.3", features = ["wasm-bindgen"] } diff --git a/crates/ironrdp-web/src/lib.rs b/crates/ironrdp-web/src/lib.rs index 9193b2b3..16fbe711 100644 --- a/crates/ironrdp-web/src/lib.rs +++ b/crates/ironrdp-web/src/lib.rs @@ -13,6 +13,8 @@ extern crate chrono as _; extern crate getrandom as _; extern crate time as _; +use getrandom2 as _; + #[macro_use] extern crate tracing;