Skip to content
Snippets Groups Projects
Forked from Game Development / Game Library
176 commits behind the upstream repository.
build.sh 881 B
#! /bin/bash

CACHE=/tmp/fggl/
LOG=$CACHE/demo.log

BUILD_PATH="builds/cli"
DEMO_EXE="$PWD/$BUILD_PATH/demo/demo"

# check cmake exists
if [ ! -x "$(command -v cmake)" ]; then
	sudo dnf install -y cmake extra-cmake-modules
	sudo dnf install -y wayland-devel libxkbcommon-devel wayland-protocols-devel
	sudo dnf install -y glew-devel glm-devel
fi

# if doing shader development, disable the cache to make sure changes take affect
rm -rf builds/cli
rm -rf $CACHE

#
# build step
#
cmake -S . -B $BUILD_PATH -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build $BUILD_PATH
cmake --install $BUILD_PATH --prefix /tmp/fggl-lib

#
# additional stuff
#

#EXE="gdb $EXE"

# gamemoderun
if [ -x "$(command -v gamemoderun)" ]; then
    DEMO_EXE="gamemoderun $DEMO_EXE"
fi

# mangohud
if [ -x "$(command -v mangohud)" ]; then
    DEMO_EXE="mangohud --dlsym $DEMO_EXE"
fi

pushd demo
$DEMO_EXE
popd