From 0236449badb83d771ac6e749e0f2ee908b942c67 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 21 Sep 2024 15:50:00 +0200 Subject: add makec --- .local/share/bin/makec | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .local/share/bin/makec 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" "$@" + -- cgit v1.2.3