mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-10 18:09:32 +00:00
Add box3d build script for Linux + macOS
This commit is contained in:
BIN
vendor/box3d/lib/darwin-arm64/libbox3d.a
vendored
Normal file
BIN
vendor/box3d/lib/darwin-arm64/libbox3d.a
vendored
Normal file
Binary file not shown.
32
vendor/box3d/src/build.sh
vendored
Executable file
32
vendor/box3d/src/build.sh
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Detect OS
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
OS="darwin"
|
||||
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
OS="linux"
|
||||
else
|
||||
echo "Error: Unsupported operating system: $OSTYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Detect architecture
|
||||
ARCH=$(uname -m)
|
||||
case "$ARCH" in
|
||||
x86_64|amd64)
|
||||
ARCH="amd64"
|
||||
;;
|
||||
arm64|aarch64)
|
||||
ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
LIB_DIR="../lib/${OS}-${ARCH}"
|
||||
mkdir -p "$LIB_DIR"
|
||||
cc -c -O2 -std=c17 -fPIC -Iinclude src/*.c
|
||||
ar rcs "$LIB_DIR/libbox3d.a" *.o
|
||||
rm -f *.o
|
||||
Reference in New Issue
Block a user