Add Web export presets and update Rust configuration for Emscripten

This commit is contained in:
2026-01-24 19:17:08 +01:00
parent 93200fc1aa
commit 77ae997af4
5 changed files with 263 additions and 3 deletions

20
rust/.cargo/config.toml Normal file
View File

@@ -0,0 +1,20 @@
[target.wasm32-unknown-emscripten]
rustflags = [
"-C",
"link-args=-pthread", # Required for Thread Support
"-C",
"target-feature=+atomics", # Required for Thread Support
"-C",
"link-args=-sSIDE_MODULE=2", # Compiles as a dynamic library for Godot to load
"-C",
"llvm-args=-enable-emscripten-cxx-exceptions=0",
"-Z",
"default-visibility=hidden", # Prevents symbol conflicts
"-Z",
"link-native-libraries=no",
"-Z",
"emscripten-wasm-eh=false",
]
[env]
GODOT4_BIN = { value = "/usr/bin/godot", force = true }