aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-04-10 17:42:23 +0100
committerLasse Collin <lasse.collin@tukaani.org>2024-04-11 00:15:35 +0300
commit8709407a9ef8e7e8aec117879400e4dd3e227ada (patch)
tree60f0850dac06df12607a4c563d59178f9881b047
parentci: default to -O2 (diff)
downloadxz-8709407a9ef8e7e8aec117879400e4dd3e227ada.tar.xz
ci: build in parallel by default
-rwxr-xr-xbuild-aux/ci_build.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/build-aux/ci_build.sh b/build-aux/ci_build.sh
index da780f33..d40cd3ce 100755
--- a/build-aux/ci_build.sh
+++ b/build-aux/ci_build.sh
@@ -48,6 +48,8 @@ DEST_DIR="$SRC_DIR/../xz_build"
PHASE="all"
ARTIFACTS_DIR_NAME="output"
+[[ -z ${CPU_COUNT} ]] && { CPU_COUNT=$(nproc 2>/dev/null || sysctl -n hw.ncpu); }
+[[ -z ${MAKEFLAGS} ]] && export MAKEFLAGS="-j${CPU_COUNT} -l${CPU_COUNT}"
[[ -z ${CFLAGS} ]] && export CFLAGS="-O2"
###################