mirror of
https://github.com/godotengine/godot-build-scripts.git
synced 2025-12-31 05:48:35 +03:00
Refactor build scripts to allow building only Classical or Mono
The in-container build scripts now get passed CLASSICAL and MONO env variables which can be used to build one or the other, or both (default). `build.sh`, `build-release.sh` and `build-templates.sh` now all expect command line switches to specify the version details, and optionally which flavor to build. For example to build Mono only: ./build.sh -v 3.2-beta4 -g master -b mono ./build-release.sh -v 3.2-beta4 -b mono ./build-templates.sh -v 3.2-beta4 -t 3.2.beta4 -b mono Also took the opportunity to do some extra cleanup, like removing unnecessary `builtin_*` options since they all default to True, even for Linux in 3.2, as well as `use_lto` and `use_static_cpp` options on platforms which don't implement them. And I improved the `build-release.sh` script to be a bit easier to read, and avoid having too many stray folders to cleanup. The build scripts should now generate the final structure that we'd use on the official mirrors, with the `mono` distribution as a subfolder of the main release folder.
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Config
|
||||
|
||||
export BUILD_NAME=official
|
||||
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
|
||||
export OPTIONS="builtin_libpng=yes builtin_openssl=yes builtin_zlib=yes debug_symbols=no use_static_cpp=yes use_lto=yes"
|
||||
export OPTIONS="debug_symbols=no use_lto=yes"
|
||||
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
|
||||
export TERM=xterm
|
||||
export MONO32_PREFIX=/root/dependencies/mono-32
|
||||
@@ -15,49 +17,63 @@ mkdir godot
|
||||
cd godot
|
||||
tar xf /root/godot.tar.gz --strip-components=1
|
||||
|
||||
cp /root/mono-glue/*.cpp modules/mono/glue/
|
||||
cp -r /root/mono-glue/Managed/Generated modules/mono/glue/Managed/
|
||||
# Classical
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=yes target=release_debug
|
||||
mkdir -p /root/out/x86/tools
|
||||
cp -rvp bin/* /root/out/x86/tools
|
||||
rm -rf bin
|
||||
if [ "${CLASSICAL}" == "1" ]; then
|
||||
echo "Starting classical build for Windows..."
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=no target=release_debug
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=no target=release
|
||||
mkdir -p /root/out/x86/templates
|
||||
cp -rvp bin/* /root/out/x86/templates
|
||||
rm -rf bin
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=yes target=release_debug
|
||||
mkdir -p /root/out/x64/tools
|
||||
cp -rvp bin/* /root/out/x64/tools
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=yes target=release_debug copy_mono_root=yes
|
||||
mkdir -p /root/out/x86/tools-mono
|
||||
cp -rvp bin/* /root/out/x86/tools-mono
|
||||
rm -rf bin
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=no target=release_debug
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=no target=release
|
||||
mkdir -p /root/out/x64/templates
|
||||
cp -rvp bin/* /root/out/x64/templates
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=no target=release_debug
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=no target=release
|
||||
mkdir -p /root/out/x86/templates-mono
|
||||
cp -rvp bin/* /root/out/x86/templates-mono
|
||||
rm -rf bin
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=yes target=release_debug
|
||||
mkdir -p /root/out/x86/tools
|
||||
cp -rvp bin/* /root/out/x86/tools
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=yes target=release_debug
|
||||
mkdir -p /root/out/x64/tools
|
||||
cp -rvp bin/* /root/out/x64/tools
|
||||
rm -rf bin
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=no target=release_debug
|
||||
$SCONS platform=windows bits=32 $OPTIONS tools=no target=release
|
||||
mkdir -p /root/out/x86/templates
|
||||
cp -rvp bin/* /root/out/x86/templates
|
||||
rm -rf bin
|
||||
fi
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=no target=release_debug
|
||||
$SCONS platform=windows bits=64 $OPTIONS tools=no target=release
|
||||
mkdir -p /root/out/x64/templates
|
||||
cp -rvp bin/* /root/out/x64/templates
|
||||
rm -rf bin
|
||||
# Mono
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=yes target=release_debug copy_mono_root=yes
|
||||
mkdir -p /root/out/x64/tools-mono
|
||||
cp -rvp bin/* /root/out/x64/tools-mono
|
||||
rm -rf bin
|
||||
if [ "${MONO}" == "1" ]; then
|
||||
echo "Starting Mono build for Windows..."
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=no target=release_debug
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=no target=release
|
||||
mkdir -p /root/out/x64/templates-mono
|
||||
cp -rvp bin/* /root/out/x64/templates-mono
|
||||
rm -rf bin
|
||||
cp /root/mono-glue/*.cpp modules/mono/glue/
|
||||
cp -r /root/mono-glue/Managed/Generated modules/mono/glue/Managed/
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=yes target=release_debug copy_mono_root=yes
|
||||
mkdir -p /root/out/x64/tools-mono
|
||||
cp -rvp bin/* /root/out/x64/tools-mono
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=no target=release_debug
|
||||
$SCONS platform=windows bits=64 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO64_PREFIX tools=no target=release
|
||||
mkdir -p /root/out/x64/templates-mono
|
||||
cp -rvp bin/* /root/out/x64/templates-mono
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=yes target=release_debug copy_mono_root=yes
|
||||
mkdir -p /root/out/x86/tools-mono
|
||||
cp -rvp bin/* /root/out/x86/tools-mono
|
||||
rm -rf bin
|
||||
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=no target=release_debug
|
||||
$SCONS platform=windows bits=32 $OPTIONS $OPTIONS_MONO mono_prefix=$MONO32_PREFIX tools=no target=release
|
||||
mkdir -p /root/out/x86/templates-mono
|
||||
cp -rvp bin/* /root/out/x86/templates-mono
|
||||
rm -rf bin
|
||||
fi
|
||||
|
||||
echo "Windows build successful"
|
||||
|
||||
Reference in New Issue
Block a user