diff options
-rwxr-xr-x | .local/share/bin/makec | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/share/bin/makec b/.local/share/bin/makec new file mode 100755 index 0000000..e89ced1 --- /dev/null +++ b/.local/share/bin/makec @@ -0,0 +1,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" "$@" + |