Everything below was tested with Godot 4.1.1, gdext at commit master@639aeb495f8f43fe68a326f6abe70a8ce4694ce3, Rust v1.72.0 (when using the stable channel), Rust v1.74.0-nightly (5ae769f06 2023-09-26, when using the nightly channel) and emsdk v3.1.28, in a Debian 12 podman container.
- Setup: So far, to reach the furthest progress I could find in gdext WebAssembly export, it seems you need at least to:
- Use the Emscripten flags
--no-entry -sSIDE_MODULE=2 -sUSE_PTHREADS=1
(last one appears to be superseded by -pthread on recent versions);- To apply those flags, one can add to the env var RUSTFLAGS
-C link-arg=emscripten-flag-here
for each emscripten flag. - You can also avoid having to use RUSTFLAGS by adding the flags to
project/rust/.cargo/config.toml
in the format
[target.wasm32-unknown-emscripten] rustflags = [ "-Clink-arg=--no-entry",
- To apply those flags, one can add to the env var RUSTFLAGS
- Use the Emscripten flags