refactor: use small_rng for Emscripten only, simplify platform to top-level functions only, no trait/struct

This commit is contained in:
Ryan Walters
2025-09-03 11:11:04 -05:00
parent 208ad3e733
commit 4cc5816d1f
9 changed files with 256 additions and 251 deletions

View File

@@ -25,7 +25,6 @@ tracing-error = "0.2.0"
tracing-subscriber = {version = "0.3.20", features = ["env-filter"]}
thiserror = "2.0.16"
anyhow = "1.0"
rand = { version = "0.9.2", default-features = false, features = ["small_rng", "os_rng"] }
smallvec = "1.15.1"
bitflags = "2.9.4"
micromap = "0.1.0"
@@ -48,6 +47,7 @@ windows-sys = { version = "0.60.2", features = ["Win32_System_Console"] }
[target.'cfg(not(target_os = "emscripten"))'.dependencies]
# On desktop platforms, build SDL2 with cargo-vcpkg
sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures", "static-link", "use-vcpkg"] }
rand = { version = "0.9.2", default-features = false, features = ["thread_rng"] }
spin_sleep = "1.3.2"
# Browser-specific dependencies
@@ -55,6 +55,7 @@ spin_sleep = "1.3.2"
# On Emscripten, we don't use cargo-vcpkg
sdl2 = { version = "0.38", default-features = false, features = ["image", "ttf", "gfx", "mixer", "unsafe_textures"] }
# TODO: Document why Emscripten cannot use `os_rng`.
rand = { version = "0.9.2", default-features = false, features = ["small_rng", "os_rng"] }
libc = "0.2.175" # TODO: Describe why this is required.
[dev-dependencies]