Files
fastvoxel/build.sh
2026-03-12 19:25:03 +03:30

28 lines
903 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Exit on error
set -e
# Configuration
GODOT_PROJECT="../minekoloft" # relative path to Godot project
LIB_NAME="fastvoxel" # your library name
DEST_LINUX="$GODOT_PROJECT/addons/fastvoxel/bin/linux"
DEST_WINDOWS="$GODOT_PROJECT/addons/fastvoxel/bin/windows"
# Build for Linux (native)
echo "Building for Linux (native)..."
cargo build --release
# Copy the shared library
mkdir -p "$DEST_LINUX"
cp "target/release/lib${LIB_NAME}.so" "$DEST_LINUX/"
echo "Copied to $DEST_LINUX"
# Optional: Crosscompile for Windows (if needed)
# Uncomment the following lines if you have the Windows target installed
echo "Building for Windows (cross-compile)..."
cargo build --release --target x86_64-pc-windows-gnu
mkdir -p "$DEST_WINDOWS"
cp "target/x86_64-pc-windows-gnu/release/${LIB_NAME}.dll" "$DEST_WINDOWS/"
echo "Copied to $DEST_WINDOWS"
echo "Done."