Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pgbiel/hello-gdext-wasm
Rust `gdext` wasm test project
https://github.com/pgbiel/hello-gdext-wasm
Last synced: 2 days ago
JSON representation
Rust `gdext` wasm test project
- Host: GitHub
- URL: https://github.com/pgbiel/hello-gdext-wasm
- Owner: PgBiel
- License: mit
- Created: 2023-10-06T00:11:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-19T23:43:50.000Z (about 1 year ago)
- Last Synced: 2025-01-03T07:07:25.298Z (8 days ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hello-gdext-wasm
Rust `gdext` wasm test project## Setup
(Full info at https://gist.github.com/PgBiel/ffa695a479ef4466cb24755db983950b)
1. Ensure you have nightly cargo installed through `rustup`
- E.g. `rustup toolchain install nightly`
2. Add the following to `~/.cargo/config.toml`:```toml
rustflags = [
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals",
][unstable]
build-std = ["panic_abort", "std"]
```The above will ensure the Rust standard library will be buit whenever using a nightly toolchain.
This is necessary to use the flags listed above while compiling the standard library.3. Ensure you have emsdk v3.1.45
- If you don't have it, you may follow these steps:
1. Go to a directory where to install it
2. `git clone https://github.com/emscripten-core/emsdk.git`
3. `cd emsdk`
4. `./emsdk install 3.1.45`
5. `./emsdk activate 3.1.45`
6. `source ./emsdk_env.sh`
7. Confirm with `emcc --version`4. Come back to this project's root folder with `cd`, and run `cd rust`
5. Run `cargo +nightly build --target wasm32-unknown-emscripten` to build the Rust code
- **Note:** cargo may ask you to run a rustup command to fetch the Rust standard library's source code.
If prompted with a suggested `rustup` command, make sure to run it.
6. You can now open the `godot/` folder in the Godot editor and attempt to export to the web.