From fea5329205cb0d2cf1c054a4d406a47ffdc204be Mon Sep 17 00:00:00 2001
From: Joe Garcia <joe.garcia@ssec.wisc.edu>
Date: Sat, 5 Jun 2021 10:12:31 -0500
Subject: [PATCH] ninja flags, to control how parallel (default is all cores).
 version we build doesn't natively use the env variable, so we use it directly

---
 ShellB3/shallbethree.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ShellB3/shallbethree.sh b/ShellB3/shallbethree.sh
index 9f1b3186..ccc5b9ac 100755
--- a/ShellB3/shallbethree.sh
+++ b/ShellB3/shallbethree.sh
@@ -1745,7 +1745,7 @@ _cmake_ninja() {
   echo "building ${name} for $BASE" 1>&2
   (cd build/${buildir}  \
    && ${CMAKE} -G Ninja -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${BASE} "${CMAKEEXTRA[@]}" "$@" ${prefpath} \
-   && ninja ${NINJAPARMS} ) \
+   && ninja ${NINJAPARMS} ${NINJAFLAGS} ) \
   || oops "${name} build failed"
 }
 
@@ -1821,7 +1821,7 @@ _meson_ninja_install() {
    && meson --prefix "${BASE}" --buildtype=plain sb3_build \
       -Dc_args="${CFLAGS}" -Dcpp_args="${CXXFLAGS}" -Dc_link_args="${LDFLAGS}" "$@" \
    && cd sb3_build \
-   && ninja -v \
+   && ninja -v ${NINJAFLAGS} \
    && ninja install ) \
    || oops "${name} meson-ninja build failed"
    fixla
@@ -13464,6 +13464,7 @@ list_envs(){
   echo "BUILD_LLVM_FOR_PYSIDE - set to yes to try to build llvm for pyside if it isn't already"
   echo "PORTABLESHELLB3 - default YES will build most its own libraries. if set NO will link to any acceptable system libraries." 1>&2
   echo "MAKEFLAGS       - can be set to parallel building with make by setting to '-j8' or the like" 1>&2
+  echo "NINJAFLAGS       - can be set to control parallel building with make by setting to '-j8' or the like" 1>&2
   #echo "PYBUILDFLAGS    - can be set to parallel building with python by setting to '-j 8' or the like" 1>&2
 }
 
-- 
GitLab