mirror of
https://github.com/godotengine/godot-build-scripts.git
synced 2026-01-05 06:11:49 +03:00
Equivalent to debug_symbols=no use_lto=yes use_static_cpp=yes. We keep LTO disabled for iOS as users need to relink on deploy, and that's very slow and memory hungry with LTO.
75 lines
2.3 KiB
Bash
Executable File
75 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Config
|
|
|
|
export BUILD_NAME=official
|
|
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
|
|
export OPTIONS="production=yes"
|
|
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
|
|
export TERM=xterm
|
|
|
|
# i386 doesn't play nice with -static-libstdc++, so we should link dynamically
|
|
# against an old enough GCC for compatibility with newer distros - so we only
|
|
# use a recent GCC for x86_64. See godotengine/godot#31743.
|
|
# Without defining CC/CXX, we use the default GCC 4.8.
|
|
if [ "$(getconf LONG_BIT)" == "64" ]; then
|
|
export CC="gcc-9"
|
|
export CXX="g++-9"
|
|
else
|
|
export OPTIONS="$OPTIONS use_static_cpp=no"
|
|
export CC="gcc"
|
|
export CXX="g++"
|
|
fi
|
|
|
|
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 Linux..."
|
|
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS tools=yes target=release_debug
|
|
mkdir -p /root/out/tools
|
|
cp -rvp bin/* /root/out/tools
|
|
rm -rf bin
|
|
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS tools=no target=release_debug
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS tools=no target=release
|
|
mkdir -p /root/out/templates
|
|
cp -rvp bin/* /root/out/templates
|
|
rm -rf bin
|
|
fi
|
|
|
|
# Mono
|
|
|
|
if [ "${MONO}" == "1" ]; then
|
|
echo "Starting Mono build for Linux..."
|
|
|
|
cp /root/mono-glue/*.cpp modules/mono/glue/
|
|
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
|
|
cp -r /root/mono-glue/GodotSharp/GodotSharpEditor/Generated modules/mono/glue/GodotSharp/GodotSharpEditor/
|
|
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig/
|
|
|
|
# Workaround for MSBuild segfault on Ubuntu containers, we build the CIL on Fedora and copy here.
|
|
mkdir -p bin
|
|
cp -r /root/mono-glue/cil/GodotSharp bin/
|
|
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS $OPTIONS_MONO tools=yes target=release_debug copy_mono_root=yes build_cil=no
|
|
mkdir -p /root/out/tools-mono
|
|
cp -rvp bin/* /root/out/tools-mono
|
|
rm -rf bin
|
|
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS $OPTIONS_MONO tools=no target=release_debug
|
|
$SCONS platform=x11 CC=$CC CXX=$CXX $OPTIONS $OPTIONS_MONO tools=no target=release
|
|
mkdir -p /root/out/templates-mono
|
|
cp -rvp bin/* /root/out/templates-mono
|
|
rm -rf bin
|
|
fi
|
|
|
|
echo "Linux build successful"
|