Skip to content

Commit

Permalink
[godot] Fix macOS build, add assemblies to .app.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Jul 19, 2023
1 parent e525c77 commit 157b938
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions spine-godot/build/build-v4.sh
Expand Up @@ -37,25 +37,28 @@ fi

mono_module=""
mono_extension=""
if [ $mono = "true" ]; then
if [ $mono == "true" ]; then
mono_module="module_mono_enabled=yes"
mono_extension=".mono"
echo "Building Godot with C# support"
else
echo "Building Godot without C# support"
fi

dev_extension=""
if [ $dev = "true" ]; then
if [ $dev == "true" ]; then
dev_extension=".dev"
target="$target dev_build=true"
fi

cpus=2
if [ "$OSTYPE" = "msys" ]; then
if [ "$OSTYPE" == "msys" ]; then
os="windows"
cpus=$NUMBER_OF_PROCESSORS
target="vsproj=yes livepp=$LIVEPP"
godot_exe="godot.windows.editor$dev_extension.x86_64$mono_extension.exe"
godot_exe_host=$godot_exe
elif [[ "$OSTYPE" = "darwin"* ]]; then
elif [[ "$OSTYPE" == "darwin"* ]]; then
os="macos"
cpus=$(sysctl -n hw.logicalcpu)
godot_exe="godot.macos.editor$dev_extension.x86_64$mono_extension"
Expand All @@ -74,10 +77,10 @@ fi
echo "CPUS: $cpus"

pushd ../godot
if [ "$os" = "macos" ] && [ $dev = "false" ]; then
if [ "$os" == "macos" ] && [ $dev == "false" ]; then
scons $target $mono_module arch=x86_64 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
if [ $mono = "true" ]; then
if [ $mono == "true" ]; then
echo "Building C# glue and assemblies."
"./bin/$godot_exe_host" --generate-mono-glue modules/mono/glue
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ../godot-nuget
Expand All @@ -90,10 +93,13 @@ if [ "$os" = "macos" ] && [ $dev = "false" ]; then
strip -S -x Godot
cp Godot Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
if [ $mono == "true" ]; then
cp -r GodotSharp Godot.app/Contents/Resources
fi
popd
else
scons $target $mono_module compiledb=yes custom_modules="../spine_godot" opengl3=yes --jobs=$cpus
if [ $mono = "true" ]; then
if [ $mono == "true" ]; then
echo "Building C# glue and assemblies."
"./bin/$godot_exe_host" --generate-mono-glue modules/mono/glue
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin --push-nupkgs-local ../godot-nuget
Expand Down

0 comments on commit 157b938

Please sign in to comment.