Skip to content

Commit 0d85e09

Browse files
authored
Merge pull request #14 from godotengine/js-threads-gdnative
JS: Build with threads and gdnative where supported + re-enable LTO
2 parents fe6e7b1 + 1bd0697 commit 0d85e09

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

build-javascript/build.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ set -e
66

77
export BUILD_NAME=official
88
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
9-
export OPTIONS="debug_symbols=no use_lto=no"
10-
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes mono_prefix=/root/mono-installs/wasm-runtime-release"
9+
export OPTIONS="debug_symbols=no use_lto=yes"
10+
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)