mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
platform-specific build script that generates and organizes library for embedding into Go binaries
This commit is contained in:
parent
992324f318
commit
322c2859e6
1 changed files with 43 additions and 0 deletions
43
bindings/go/build_lib.sh
Executable file
43
bindings/go/build_lib.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
# bindings/go/build_lib.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Building Limbo Go library for current platform..."
|
||||
|
||||
# Determine platform-specific details
|
||||
case "$(uname -s)" in
|
||||
Darwin*)
|
||||
OUTPUT_NAME="lib_limbo_go.dylib"
|
||||
PLATFORM="darwin_$(uname -m)"
|
||||
;;
|
||||
Linux*)
|
||||
OUTPUT_NAME="lib_limbo_go.so"
|
||||
PLATFORM="linux_$(uname -m)"
|
||||
;;
|
||||
MINGW*|MSYS*|CYGWIN*)
|
||||
OUTPUT_NAME="lib_limbo_go.dll"
|
||||
if [ "$(uname -m)" == "x86_64" ]; then
|
||||
PLATFORM="windows_amd64"
|
||||
else
|
||||
PLATFORM="windows_386"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported platform: $(uname -s)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Create output directory
|
||||
OUTPUT_DIR="libs/${PLATFORM}"
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
# Build the library
|
||||
cargo build --release --package limbo-go
|
||||
|
||||
# Copy to the appropriate directory
|
||||
echo "Copying $OUTPUT_NAME to $OUTPUT_DIR/"
|
||||
cp "../../target/release/$OUTPUT_NAME" "$OUTPUT_DIR/"
|
||||
|
||||
echo "Library built successfully for $PLATFORM"
|
Loading…
Add table
Add a link
Reference in a new issue