Files
sunnypilot/third_party/raylib/setup.sh
Adeeb Shihadeh 2c98c6d52b third_party: setup raylib (#33367)
* setup raylib

* x86 build

* add larch

* darwin

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 4b70cc9286
2024-08-24 16:39:00 -07:00

37 lines
656 B
Bash
Executable File

#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR
ARCHNAME=$(uname -m)
if [ -f /TICI ]; then
ARCHNAME="larch64"
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
ARCHNAME="Darwin"
fi
if [ ! -d raylib_repo ]; then
git clone https://github.com/raysan5/raylib.git raylib_repo
fi
cd raylib_repo
git fetch --tags origin 5.0
git checkout 5.0
git clean -xdff .
mkdir build
cd build
cmake ..
make -j$(nproc)
INSTALL_DIR="$DIR/$ARCHNAME"
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR
rm -rf $DIR/include
cp $DIR/raylib_repo/build/raylib/libraylib.a $INSTALL_DIR/
cp -r $DIR/raylib_repo/build/raylib/include $DIR