-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuild.sh
executable file
·97 lines (76 loc) · 2.46 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
set -e
# Config
# To speed up builds with single-threaded full LTO linking,
# we run all builds in parallel each from their own folder.
export NUM_JOBS=5
declare -a JOBS=(
"target=template_debug"
"target=template_release"
"target=template_debug dlink_enabled=yes"
"target=template_release dlink_enabled=yes"
)
declare -a JOBS_NOTHREADS=(
"target=template_debug threads=no"
"target=template_release threads=no"
"target=template_debug dlink_enabled=yes threads=no"
"target=template_release dlink_enabled=yes threads=no"
)
export SCONS="scons -j$(expr ${NUM_CORES} / ${NUM_JOBS}) verbose=yes warnings=no progress=no"
export OPTIONS="production=yes"
export OPTIONS_MONO="module_mono_enabled=yes -j${NUM_CORES}"
export TERM=xterm
source /root/emsdk/emsdk_env.sh
rm -rf godot
mkdir godot
cd godot
tar xf /root/godot.tar.gz --strip-components=1
# Classical
if [ "${CLASSICAL}" == "1" ]; then
echo "Starting classical build for Web..."
for i in {0..3}; do
cp -r /root/godot /root/godot$i
cd /root/godot$i
echo "$SCONS platform=web ${OPTIONS} ${JOBS[$i]}"
$SCONS platform=web ${OPTIONS} ${JOBS[$i]} &
pids[$i]=$!
done
cd /root/godot
echo "$SCONS platform=web ${OPTIONS} target=editor use_closure_compiler=yes"
$SCONS platform=web ${OPTIONS} target=editor use_closure_compiler=yes &
pid_editor=$!
for pid in ${pids[*]}; do
wait $pid
done
wait $pid_editor
for i in {0..3}; do
cp -r /root/godot /root/godot-nothreads$i
cd /root/godot-nothreads$i
echo "$SCONS platform=web ${OPTIONS} ${JOBS_NOTHREADS[$i]}"
$SCONS platform=web ${OPTIONS} ${JOBS_NOTHREADS[$i]} &
pids_nothreads[$i]=$!
done
for pid in ${pids_nothreads[*]}; do
wait $pid
done
mkdir -p /root/out/tools
cp -rvp /root/godot/bin/*.editor*.zip /root/out/tools
mkdir -p /root/out/templates
for i in {0..3}; do
cp -rvp /root/godot$i/bin/*.zip /root/out/templates
cp -rvp /root/godot-nothreads$i/bin/*.zip /root/out/templates
done
fi
# Mono
# No Web support with .NET 6 yet.
#if [ "${MONO}" == "1" ]; then
if false; then
echo "Starting Mono build for Web..."
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
$SCONS platform=web ${OPTIONS} ${OPTIONS_MONO} target=template_debug
$SCONS platform=web ${OPTIONS} ${OPTIONS_MONO} target=template_release
mkdir -p /root/out/templates-mono
cp -rvp bin/*.zip /root/out/templates-mono
rm -f bin/*.zip
fi
echo "Web build successful"