forked from VoylinsGamedevJourney/gozen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·124 lines (105 loc) · 2.19 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
echo "-= GoZen Builder =-"
echo "1. Build GoZen [full]"
echo "2. Build GoZen [light]"
echo "3. Generate localization"
echo "4. Compile GDExtension"
read -p "> " choice
function build_gozen_full() {
generate_localization
compile_gdextension
}
function build_gozen_light() {
generate_localization
compile_gdextension
}
function generate_localization() {
pushd src/translations/gozen-translations
git pull
./generate_mo_files.sh
popd
}
function compile_gdextension() {
echo "Updating godot-cpp"
pushd src/bin/gde_ffmpeg/godot-cpp
git pull
popd
local scons_extra_args=""
echo "GDExtension compiling"
echo "Select target platform:"
echo "1. Linux"
echo "2. Windows (Msys2)"
echo "3. Mac (not-supported yet)"
read -p "> " platform
case $platform in
1)
platform=linux
;;
2)
platform=windows
scons_extra_args="use_mingw=yes"
;;
3)
platform=macos
echo "MacOS export not supported yet!"
exit 1
;;
*)
echo "Choosing platform=linuxbsd as no (valid) argument was given."
platform=linuxbsd
;;
esac
echo "Select build taget:"
echo "1. template_debug"
echo "2. template_release"
read -p "> " target
case $target in
1)
target=template_debug
;;
2)
target=template_release
;;
*)
echo "Choosing target=template_debug as no (valid) argument was given."
target=template_debug
;;
esac
echo "Enter amount of cores/thread for compiling:"
read -p "> " num_jobs
echo "Build FFmpeg? (y/N)"
read -p "> " ffmpeg
case $ffmpeg in
y)
pushd src/bin/gde_ffmpeg/
./build-ffmpeg.sh $platform $num_jobs || { echo "FFmpeg build failed"; exit 1; }
popd
;;
*)
;;
esac
pushd src/bin/gde_ffmpeg/
scons -j $num_jobs target=$target platform=$platform $scons_extra_args
popd
}
case $choice in
1)
echo "Building GoZen Full"
build_gozen_full
;;
2)
echo "Building GoZen Light"
build_gozen_light
;;
3)
echo "Generating Localization"
generate_localization
;;
4)
echo "Compiling GDExtension"
compile_gdextension
;;
*)
echo "Invalid choice"
;;
esac