From ef5d609f4a99be87c91ca66e157e787f6bd09e1b Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sun, 13 Oct 2024 19:02:27 +0300 Subject: [PATCH] /bin/build.sh: search for ninja and use it by default --- bin/build.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 3511281..ff7a922 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,7 +1,12 @@ #!/bin/env sh -if [ "$1" = "web" ]; then - emcmake cmake -B .build-web "${@:2}" && cmake --build .build-web --parallel -else - cmake -B .build "$@" && cmake --build .build --parallel +# check whether ninja is around (you better start running) +if [ -x "$(command -v ninja)" ]; then + generator="-G Ninja" +fi + +if [ "$1" = "web" ]; then + emcmake cmake $generator -B .build-web "${@:2}" && cmake --build .build-web --parallel +else + cmake $generator -B .build "$@" && cmake --build .build --parallel fi