build(physics-rs): 📦️ Update GDExtension build script for Rust physics module with cross-platform optimizations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
92b2f6b179
commit
549aea7d4b
1 changed files with 27 additions and 0 deletions
|
|
@ -1,4 +1,31 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
TARGET=${1:-x86_64-unknown-linux-gnu}
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ADDON_DIR="$SCRIPT_DIR/../../engine/addons/magic_civ_physics"
|
||||
|
||||
cargo build --release --features gdext --target "$TARGET"
|
||||
|
||||
mkdir -p "$ADDON_DIR"
|
||||
|
||||
case "$TARGET" in
|
||||
x86_64-unknown-linux-gnu)
|
||||
cp "$SCRIPT_DIR/target/$TARGET/release/libmagic_civ_physics.so" \
|
||||
"$ADDON_DIR/libmagic_civ_physics.x86_64.so"
|
||||
echo "Copied → engine/addons/magic_civ_physics/libmagic_civ_physics.x86_64.so"
|
||||
;;
|
||||
x86_64-pc-windows-gnu|x86_64-pc-windows-msvc)
|
||||
cp "$SCRIPT_DIR/target/$TARGET/release/magic_civ_physics.dll" \
|
||||
"$ADDON_DIR/magic_civ_physics.x86_64.dll"
|
||||
echo "Copied → engine/addons/magic_civ_physics/magic_civ_physics.x86_64.dll"
|
||||
;;
|
||||
aarch64-apple-darwin|x86_64-apple-darwin)
|
||||
cp "$SCRIPT_DIR/target/$TARGET/release/libmagic_civ_physics.dylib" \
|
||||
"$ADDON_DIR/libmagic_civ_physics.dylib"
|
||||
echo "Copied → engine/addons/magic_civ_physics/libmagic_civ_physics.dylib"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown target $TARGET — skipping copy. Place .so/.dll manually in engine/addons/magic_civ_physics/"
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue