mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Rework extension build system.
This commit is contained in:
parent
e9cce58a1f
commit
72846c46f0
1
.gitignore
vendored
1
.gitignore
vendored
@ -216,3 +216,4 @@ spine-godot/bin
|
|||||||
spine-godot/example-v4-extension/bin/macos/macos.framework/libspine_godot.macos.editor
|
spine-godot/example-v4-extension/bin/macos/macos.framework/libspine_godot.macos.editor
|
||||||
spine-godot/.idea
|
spine-godot/.idea
|
||||||
spine-godot/build/version.txt
|
spine-godot/build/version.txt
|
||||||
|
spine-godot/vc140.pdb
|
||||||
|
|||||||
55
spine-godot/build/build-extension.sh
Normal file
55
spine-godot/build/build-extension.sh
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
|
pushd "$dir" > /dev/null
|
||||||
|
|
||||||
|
if [ ! -d ../godot-cpp ]; then
|
||||||
|
echo "No godot-cpp clone found. Run ./setup-extension.sh <Godot branch or tag> <dev> first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
options=""
|
||||||
|
dev="false"
|
||||||
|
platform=${1%/}
|
||||||
|
|
||||||
|
if [ -f "../godot-cpp/dev" ]; then
|
||||||
|
dev="true"
|
||||||
|
echo "DEV build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $dev == "true" ]; then
|
||||||
|
options="$options dev_build=true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $platform ]; then
|
||||||
|
echo "Platform: current"
|
||||||
|
else
|
||||||
|
echo "Platform: $platform"
|
||||||
|
platform="platform=$platform"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cpus=2
|
||||||
|
if [ "$OSTYPE" == "msys" ]; then
|
||||||
|
os="windows"
|
||||||
|
cpus=$NUMBER_OF_PROCESSORS
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
os="macos"
|
||||||
|
cpus=$(sysctl -n hw.logicalcpu)
|
||||||
|
if [ `uname -m` == "arm64" ]; then
|
||||||
|
echo "Would do Apple Silicon specific setup"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
os="linux"
|
||||||
|
cpus=$(grep -c ^processor /proc/cpuinfo)
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "CPUS: $cpus"
|
||||||
|
|
||||||
|
pushd ..
|
||||||
|
scons -j $cpus $options $platform target=editor
|
||||||
|
scons -j $cpus $options $platform target=template_debug
|
||||||
|
scons -j $cpus $options $platform target=template_release
|
||||||
|
popd
|
||||||
|
|
||||||
|
popd
|
||||||
@ -5,7 +5,7 @@ dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
|||||||
pushd "$dir" > /dev/null
|
pushd "$dir" > /dev/null
|
||||||
|
|
||||||
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
||||||
echo "Usage: ./setup-extension.sh <Godot version> <dev:true|false> <mono:true|false>?"
|
echo "Usage: ./setup-extension.sh <Godot version> <dev:true|false>"
|
||||||
echo
|
echo
|
||||||
echo "e.g.:"
|
echo "e.g.:"
|
||||||
echo " ./setup-extension.sh 4.2.2-stable true"
|
echo " ./setup-extension.sh 4.2.2-stable true"
|
||||||
@ -53,17 +53,20 @@ echo "cpus: $cpus"
|
|||||||
pushd ..
|
pushd ..
|
||||||
|
|
||||||
rm -rf godot-cpp
|
rm -rf godot-cpp
|
||||||
git clone $godot_cpp_repo
|
git clone --depth 1 $godot_cpp_repo -b $godot_cpp_branch
|
||||||
pushd godot-cpp
|
|
||||||
git checkout $godot_cpp_branch
|
|
||||||
popd
|
|
||||||
|
|
||||||
rm -rf godot
|
if [ $dev == "true" ]; then
|
||||||
git clone $godot_repo
|
echo "Dev build, creating godot-cpp/dev"
|
||||||
pushd godot
|
touch godot-cpp/dev
|
||||||
git checkout $godot_branch
|
rm -rf godot
|
||||||
scons target=editor dev_build=true optimize=debug --jobs=$cpus
|
git clone --depth 1 $godot_repo -b $godot_branch
|
||||||
popd
|
pushd godot
|
||||||
|
scons target=editor dev_build=true optimize=debug --jobs=$cpus
|
||||||
|
popd
|
||||||
|
cp spine_godot_extension.dev.gdextension example-v4-extension/bin/spine_godot_extension.gdextension
|
||||||
|
else
|
||||||
|
cp spine_godot_extension.gdextension example-v4-extension/bin
|
||||||
|
fi
|
||||||
|
|
||||||
cp -r ../spine-cpp/spine-cpp spine_godot
|
cp -r ../spine-cpp/spine-cpp spine_godot
|
||||||
|
|
||||||
|
|||||||
18
spine-godot/spine_godot_extension.dev.gdextension
Normal file
18
spine-godot/spine_godot_extension.dev.gdextension
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[configuration]
|
||||||
|
|
||||||
|
entry_symbol = "spine_godot_library_init"
|
||||||
|
compatibility_minimum = "4.1"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
|
||||||
|
macos.editor = "res://bin/macos/macos.framework/libspine_godot.macos.dev.editor"
|
||||||
|
macos.debug = "res://bin/macos/macos.framework/libspine_godot.macos.dev.template_debug"
|
||||||
|
macos.release = "res://bin/macos/macos.framework/libspine_godot.macos.template_release"
|
||||||
|
|
||||||
|
windows.editor.x86_64 = "res://bin/windows/libspine_godot.windows.editor.dev.x86_64.dll"
|
||||||
|
windows.debug.x86_64 = "res://bin/windows/libspine_godot.windows.template_debug.dev.x86_64.dll"
|
||||||
|
windows.release.x86_64 = "res://bin/windows/libspine_godot.windows.template_release.dev.x86_64.dll"
|
||||||
|
|
||||||
|
linux.editor.x86_64 = "res://bin/linux/libspine_godot.linux.editor.dev.x86_64.so"
|
||||||
|
linux.debug.x86_64 = "res://bin/linux/libspine_godot.linux.template_debug.dev.x86_64.so"
|
||||||
|
linux.release.x86_64 = "res://bin/linux/libspine_godot.linux.template_release.dev.x86_64.so"
|
||||||
@ -12,9 +12,9 @@ macos.release = "res://bin/macos/macos.framework/libspine_godot.macos.template_r
|
|||||||
ios.debug = "res://bin/ios/ios.framework/libspine_godot.ios.template_debug"
|
ios.debug = "res://bin/ios/ios.framework/libspine_godot.ios.template_debug"
|
||||||
ios.release = "res://bin/ios/ios.framework/libspine_godot.ios.template_release"
|
ios.release = "res://bin/ios/ios.framework/libspine_godot.ios.template_release"
|
||||||
|
|
||||||
windows.editor.x86_32 = "res://bin/windows/libspine_godot.windows.editor.x86_32.dll"
|
windows.editor.dev.x86_64 = "res://bin/windows/libspine_godot.windows.editor.dev.x86_64.dll"
|
||||||
windows.debug.x86_32 = "res://bin/windows/libspine_godot.windows.template_debug.x86_32.dll"
|
windows.debug.dev.x86_64 = "res://bin/windows/libspine_godot.windows.template_debug.dev.x86_64.dll"
|
||||||
windows.release.x86_32 = "res://bin/windows/libspine_godot.windows.template_release.x86_32.dll"
|
windows.release.dev.x86_64 = "res://bin/windows/libspine_godot.windows.template_release.dev.x86_64.dll"
|
||||||
|
|
||||||
windows.editor.x86_64 = "res://bin/windows/libspine_godot.windows.editor.x86_64.dll"
|
windows.editor.x86_64 = "res://bin/windows/libspine_godot.windows.editor.x86_64.dll"
|
||||||
windows.debug.x86_64 = "res://bin/windows/libspine_godot.windows.template_debug.x86_64.dll"
|
windows.debug.x86_64 = "res://bin/windows/libspine_godot.windows.template_debug.x86_64.dll"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user