aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/makec
blob: e89ced152a6ba68631ee5ca5ea07fd9d0b3b009f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# mini wrapper around CMake + Ninja to build in one command

BUILD_DIR="build"
CMAKE="cmake --fresh --log-level WARNING -Wno-deprecated"

if [ ! -e "$BUILD_DIR/build.ninja" ] ||
   [ "CMakeLists.txt" -nt "$BUILD_DIR/build.ninja" ] ; then
	 $CMAKE -B "$BUILD_DIR" -G Ninja
fi

if [ "$*" = "clean" ] ; then
	rm -rf "$BUILD_DIR"
	exit 0
fi

exec ninja -C "$BUILD_DIR" "$@"