project-aster/build.sh

32 lines
527 B
Bash
Executable File

#!/usr/bin/env bash
echo "Running CMake"
if grep 'NAME=NixOS' /etc/os-release
then
cmake --preset nixos
else
cmake --preset linux
fi
echo "Running Ninja"
if echo "$@" | grep -e "clean" -q
then
cmake --build build --target clean
elif echo "$@" | grep -e "rebuild" -q
then
cmake --build build --clean-first
else
cmake --build build
fi
if echo "$@" | grep -e "docs" -q
then
if echo "$@" | grep -e "-v" -q
then
doxygen
else
doxygen > /dev/null || echo "Doxygen Failed"
fi
fi