Skip to content

Commit d9ed4ad

Browse files
committed
Update build-wasm.sh, add .cargo/config.toml
1 parent c3c552a commit d9ed4ad

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ gen
2121
# Temporary tweaks, remove later
2222
/script
2323
*.bat
24-
config.toml
2524
exp.rs
2625

2726
# Mac specific
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The cargo flag "-Zbuild-std" is also required but this cannot yet be specified for specific
2+
# targets: https://github.com/rust-lang/cargo/issues/8733
3+
[target.wasm32-unknown-emscripten]
4+
rustflags = [
5+
"-C", "link-args=-sSIDE_MODULE=2",
6+
"-C", "link-args=-pthread",
7+
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals",
8+
"-Zlink-native-libraries=no",
9+
]

dodge-the-creeps/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
rand = "0.8"
1414
godot = { git = "https://github.com/godot-rust/gdext.git" }
15-
# for Wasm, add: features = ["experimental-wasm"]
15+
# For Wasm, feature "experimental-wasm" can be added, but this is already done in build-wasm.sh script.
1616

dodge-the-creeps/rust/build-wasm.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ cd `dirname "$0"`
99

1010
# We build the host gdextension first so that the godot editor doesn't complain.
1111
cargo +nightly build --package dodge-the-creeps &&
12-
cargo +nightly build --package dodge-the-creeps --target wasm32-unknown-emscripten -Zbuild-std $@
12+
cargo +nightly build --package dodge-the-creeps \
13+
--features godot/experimental-wasm,godot/lazy-function-tables \
14+
--target wasm32-unknown-emscripten -Zbuild-std $@

0 commit comments

Comments
 (0)