mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Add mono flag to 4.x build.
This commit is contained in:
parent
8d04c7a75b
commit
bdb9e130bc
@ -11,6 +11,26 @@ fi
|
|||||||
|
|
||||||
target=""
|
target=""
|
||||||
dev="false"
|
dev="false"
|
||||||
|
mono="false"
|
||||||
|
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
echo "Usage: $0 [mono:true|false]"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
if [ "$1" == "true" ] || [ "$1" == "false" ]; then
|
||||||
|
mono="$1"
|
||||||
|
else
|
||||||
|
echo "Invalid value for the 'mono' argument. It should be either 'true' or 'false'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "../godot/custom.py" ]; then
|
||||||
|
dev="true"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "../godot/custom.py" ]; then
|
if [ -f "../godot/custom.py" ]; then
|
||||||
dev="true"
|
dev="true"
|
||||||
fi
|
fi
|
||||||
@ -26,16 +46,23 @@ fi
|
|||||||
|
|
||||||
echo "CPUS: $cpus"
|
echo "CPUS: $cpus"
|
||||||
|
|
||||||
|
mono_module=""
|
||||||
|
mono_extension=""
|
||||||
|
if [ $mono = "true" ]; then
|
||||||
|
mono_module="module_mono_enabled=yes"
|
||||||
|
mono_extension=".mono"
|
||||||
|
fi
|
||||||
|
|
||||||
pushd ../godot
|
pushd ../godot
|
||||||
if [ `uname` == 'Darwin' ] && [ $dev = "false" ]; then
|
if [ `uname` == 'Darwin' ] && [ $dev = "false" ]; then
|
||||||
scons $target arch=x86_64 compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
scons $target $mono_module arch=x86_64 compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
||||||
scons $target arch=arm64 compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
scons $target $mono_module arch=arm64 compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
||||||
|
|
||||||
pushd bin
|
pushd bin
|
||||||
cp -r ../misc/dist/macos_tools.app .
|
cp -r ../misc/dist/macos_tools.app .
|
||||||
mv macos_tools.app Godot.app
|
mv macos_tools.app Godot.app
|
||||||
mkdir -p Godot.app/Contents/MacOS
|
mkdir -p Godot.app/Contents/MacOS
|
||||||
lipo -create godot.macos.editor.arm64 godot.macos.editor.x86_64 -output Godot
|
lipo -create godot.macos.editor.arm64$mono_extension godot.macos.editor.x86_64$mono_extension -output Godot
|
||||||
strip -S -x Godot
|
strip -S -x Godot
|
||||||
cp Godot Godot.app/Contents/MacOS/Godot
|
cp Godot Godot.app/Contents/MacOS/Godot
|
||||||
chmod +x Godot.app/Contents/MacOS/Godot
|
chmod +x Godot.app/Contents/MacOS/Godot
|
||||||
@ -47,11 +74,11 @@ else
|
|||||||
if [ "$dev" = "true" ]; then
|
if [ "$dev" = "true" ]; then
|
||||||
target="$target dev_build=true"
|
target="$target dev_build=true"
|
||||||
fi
|
fi
|
||||||
scons $target compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
scons $target $mono_module compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
|
||||||
cp compile_commands.json ../build
|
cp compile_commands.json ../build
|
||||||
if [ -f "bin/godot.linuxbsd.editor.x86_64" ]; then
|
if [ -f "bin/godot.linuxbsd.editor.x86_64$mono_extension" ]; then
|
||||||
strip bin/godot.linuxbsd.editor.x86_64
|
strip bin/godot.linuxbsd.editor.x86_64$mono_extension
|
||||||
chmod a+x bin/godot.linuxbsd.editor.x86_64
|
chmod a+x bin/godot.linuxbsd.editor.x86_64$mono_extension
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
|
|||||||
@ -4,18 +4,36 @@ set -e
|
|||||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
pushd "$dir" > /dev/null
|
pushd "$dir" > /dev/null
|
||||||
|
|
||||||
if [ ! "$#" -eq 2 ]; then
|
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
||||||
echo "Usage: ./setup.sh <Godot branch or tag> <dev:true|false>"
|
echo "Usage: ./setup.sh <Godot branch or tag> <dev:true|false> [mono:true|false]?"
|
||||||
echo
|
echo
|
||||||
echo "e.g.:"
|
echo "e.g.:"
|
||||||
echo " ./setup.sh 3.4.4-stable true"
|
echo " ./setup.sh 3.5.2-stable true"
|
||||||
echo " ./setup.sh master false"
|
echo " ./setup.sh master false true"
|
||||||
echo
|
echo
|
||||||
|
echo "Note: the 'mono' parameter only works for Godot 4.x+!"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
branch=${1%/}
|
branch=${1%/}
|
||||||
dev=${2%/}
|
dev=${2%/}
|
||||||
|
mono=false
|
||||||
|
|
||||||
|
if [[ $# -eq 3 && "$branch" != 3* ]]; then
|
||||||
|
mono=${3%/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$dev" != "true" ] && [ "$dev" != "false" ]; then
|
||||||
|
echo "Invalid value for the 'dev' argument. It should be either 'true' or 'false'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$mono" != "true" ] && [ "$mono" != "false" ]; then
|
||||||
|
echo "Invalid value for the 'mono' argument. It should be either 'true' or 'false'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
pushd ..
|
pushd ..
|
||||||
rm -rf godot
|
rm -rf godot
|
||||||
@ -23,6 +41,9 @@ git clone --depth 1 https://github.com/godotengine/godot.git -b $branch
|
|||||||
if [ $dev = "true" ]; then
|
if [ $dev = "true" ]; then
|
||||||
cp -r .idea godot
|
cp -r .idea godot
|
||||||
cp build/custom.py godot
|
cp build/custom.py godot
|
||||||
|
if [ "$mono" = "true" ]; then
|
||||||
|
echo "module_mono_enabled=\"yes\"" >> godot/custom.py
|
||||||
|
fi
|
||||||
cp ../formatters/.clang-format .
|
cp ../formatters/.clang-format .
|
||||||
rm -rf example/.import
|
rm -rf example/.import
|
||||||
rm -rf example/.godot
|
rm -rf example/.godot
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user