From 549aea7d4bb394eb1ce9582f21064afabf2dbae7 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 31 Mar 2026 05:51:57 -0700 Subject: [PATCH] =?UTF-8?q?build(physics-rs):=20=F0=9F=93=A6=EF=B8=8F=20Up?= =?UTF-8?q?date=20GDExtension=20build=20script=20for=20Rust=20physics=20mo?= =?UTF-8?q?dule=20with=20cross-platform=20optimizations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- packages/physics-rs/build-gdext.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/physics-rs/build-gdext.sh b/packages/physics-rs/build-gdext.sh index f4f8ea85..51f92b24 100755 --- a/packages/physics-rs/build-gdext.sh +++ b/packages/physics-rs/build-gdext.sh @@ -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