Skip to content

Commit 1bd0697

Browse files
akien-mgaFaless
andcommitted
JS: Build with threads and gdnative where supported
Classical builds now use Emscripten 2.0.10 and have threads and gdnative templates. Mono builds still use Emscripten 1.39.9 for compatibility with Mono 6.12.x, so they cannot have GDNative support which requires 2.0.10+. And threads build triggers wasm-ld errors without LTO, and wasm-ld crash with LTO, so no dice there either. Co-authored-by: Fabio Alessandrelli <[email protected]>
1 parent 37d7666 commit 1bd0697

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

build-javascript/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
99
export OPTIONS="debug_symbols=no use_lto=yes"
1010
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes mono_prefix=/root/mono-installs/wasm-runtime-release use_lto=no"
1111
export TERM=xterm
12+
export EMSDK_CLASSICAL=2.0.10
13+
export EMSDK_MONO=1.39.9
1214

1315
rm -rf godot
1416
mkdir godot
@@ -20,9 +22,17 @@ tar xf /root/godot.tar.gz --strip-components=1
2022
if [ "${CLASSICAL}" == "1" ]; then
2123
echo "Starting classical build for JavaScript..."
2224

25+
source /root/emsdk_${EMSDK_CLASSICAL}/emsdk_env.sh
26+
2327
$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no
2428
$SCONS platform=javascript ${OPTIONS} target=release tools=no
2529

30+
$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no threads_enabled=yes
31+
$SCONS platform=javascript ${OPTIONS} target=release tools=no threads_enabled=yes
32+
33+
$SCONS platform=javascript ${OPTIONS} target=release_debug tools=no gdnative_enabled=yes
34+
$SCONS platform=javascript ${OPTIONS} target=release tools=no gdnative_enabled=yes
35+
2636
mkdir -p /root/out/templates
2737
cp -rvp bin/*.zip /root/out/templates
2838
rm -f bin/*.zip
@@ -33,6 +43,8 @@ fi
3343
if [ "${MONO}" == "1" ]; then
3444
echo "Starting Mono build for JavaScript..."
3545

46+
source /root/emsdk_${EMSDK_MONO}/emsdk_env.sh
47+
3648
cp /root/mono-glue/*.cpp modules/mono/glue/
3749
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
3850
cp -r /root/mono-glue/GodotSharp/GodotSharpEditor/Generated modules/mono/glue/GodotSharp/GodotSharpEditor/

build-release.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ if [ "${build_classical}" == "1" ]; then
176176
cp out/javascript/templates/godot.javascript.opt.zip ${templatesdir}/webassembly_release.zip
177177
cp out/javascript/templates/godot.javascript.opt.debug.zip ${templatesdir}/webassembly_debug.zip
178178

179+
cp out/javascript/templates/godot.javascript.opt.threads.zip ${templatesdir}/webassembly_threads_release.zip
180+
cp out/javascript/templates/godot.javascript.opt.debug.threads.zip ${templatesdir}/webassembly_threads_debug.zip
181+
182+
cp out/javascript/templates/godot.javascript.opt.gdnative.zip ${templatesdir}/webassembly_gdnative_release.zip
183+
cp out/javascript/templates/godot.javascript.opt.debug.gdnative.zip ${templatesdir}/webassembly_gdnative_debug.zip
184+
179185
## Android (Classical) ##
180186

181187
# Lib for direct download

0 commit comments

Comments
 (0)