diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-21 15:50:00 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-21 15:50:00 +0200 |
commit | 0236449badb83d771ac6e749e0f2ee908b942c67 (patch) | |
tree | ce670de0bb4ac2257e4230df1a0c9522a7e3c672 /.local/share/bin/makec | |
parent | edf92699e07a00324a7cf06f27eb1350db658df7 (diff) |
add makec
Diffstat (limited to '.local/share/bin/makec')
-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" "$@" + |