Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Nov 28, 2024
1 parent 4226ef5 commit 1323e96
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions third_party/raylib/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,38 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd $DIR

RAYLIB_PLATFORM="PLATFORM_DESKTOP"

ARCHNAME=$(uname -m)
if [ -f /TICI ]; then
ARCHNAME="larch64"
RAYLIB_PLATFORM="PLATFORM_COMMA"
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
ARCHNAME="Darwin"
fi

INSTALL_DIR="$DIR/$ARCHNAME"
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR

INSTALL_H_DIR="$DIR/include"
rm -rf $INSTALL_H_DIR
mkdir -p $INSTALL_H_DIR

if [ ! -d raylib_repo ]; then
git clone https://github.com/raysan5/raylib.git raylib_repo
git clone -b master --no-tags https://github.com/commaai/raylib.git raylib_repo
fi

cd raylib_repo
git fetch --tags origin 5.0
git checkout 5.0

COMMIT="591b3be34d84b8c924fcc8648cce9b496580a2e8"
git fetch origin $COMMIT
git reset --hard $COMMIT
git clean -xdff .
mkdir build
cd build
cmake ..
make -j$(nproc)

INSTALL_DIR="$DIR/$ARCHNAME"
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR
cd src

rm -rf $DIR/include
cp $DIR/raylib_repo/build/raylib/libraylib.a $INSTALL_DIR/
cp -r $DIR/raylib_repo/build/raylib/include $DIR
make -j$(nproc) PLATFORM=$RAYLIB_PLATFORM
sudo make install RAYLIB_INSTALL_PATH=$INSTALL_DIR RAYLIB_H_INSTALL_PATH=$INSTALL_H_DIR

0 comments on commit 1323e96

Please sign in to comment.