From c85986462d408a13f9dc2688547fe1e2c99c2e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 9 May 2024 12:26:59 +0200 Subject: dev: allow calling meson setup directly --- shellrc.d/dev | 63 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/shellrc.d/dev b/shellrc.d/dev index 04ce496..5b1963a 100644 --- a/shellrc.d/dev +++ b/shellrc.d/dev @@ -1,6 +1,5 @@ # vim: ft=sh: - if command -v valgrind >/dev/null; then alias memcheck="valgrind --track-fds=yes --leak-check=full --track-origins=yes" @@ -10,48 +9,48 @@ if command -v valgrind >/dev/null; then fi - if command -v meson >/dev/null; then -_meson_setup() { - if [ ! -f "build/build.ninja" ]; then - meson setup -Doptimization=plain build - fi -} + msetup() { + if [[ -f "build/build.ninja" ]]; then + [[ $# -eq 0 ]] || + meson configure build "$@" + else + meson setup "$@" build + fi + } -mbuild() { - _meson_setup \ - && meson compile -C build "$@" -} + mbuild() { + msetup && + meson compile -C build "$@" + } -mtest() { - _meson_setup \ - && meson test -C build "$@" -} + mtest() { + msetup && + meson test -C build "$@" + } -mcoverage() { - _meson_setup \ - && meson configure build -Db_coverage=true \ - && meson test -C build "$@" \ - && ninja -C build coverage-html -} + mcoverage() { + msetup -Db_coverage=true && + meson test -C build "$@" && + ninja -C build coverage-html + } -mdist() { - _meson_setup \ - && meson dist -C build --formats xztar,gztar,zip "$@" -} + mdist() { + msetup && + meson dist -C build --formats xztar,gztar,zip "$@" + } -mupdate() { - meson subprojects update -} + mupdate() { + meson subprojects update + } -mpurge() { - meson subprojects purge -} + mpurge() { + meson subprojects purge + } fi - if command -v bear >/dev/null; then bmake() { -- cgit v1.2.3