diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2021-01-15 10:29:05 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-01-15 12:12:07 +0000 |
commit | 75888f273e9beae91e48e3490e50b4db9c208117 (patch) | |
tree | ce6b54f74f963886c0a686cbd37ac8365a97ecbc /ci | |
parent | 674875dc7b1fc4a63cd2ac12a6aa2a534b003f2a (diff) | |
download | libgit2-75888f273e9beae91e48e3490e50b4db9c208117.tar.gz |
ci: don't use ninja on macOS
Ninja is not installed by default on the macOS machines; stop trying to
use it. Instead use `make -j` which should be roughly equivalent in
performance but supported everywhere.
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/build.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ci/build.sh b/ci/build.sh index c230e67d6..5a51f925a 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -33,6 +33,9 @@ if [ -f "/etc/debian_version" ]; then (source /etc/lsb-release && echo "${DISTRIB_DESCRIPTION}") | indent fi +CORES=$(getconf _NPROCESSORS_ONLN || true) +echo "Number of cores: ${CORES:-(Unknown)}" + echo "Kernel version:" uname -a 2>&1 | indent @@ -64,4 +67,12 @@ echo "########################################################################## echo "## Building libgit2" echo "##############################################################################" -env PATH="${BUILD_PATH}" "${CMAKE}" --build . +# Determine parallelism; newer cmake supports `--build --parallel` but +# we cannot yet rely on that. +if [ "${CMAKE_GENERATOR}" = "Unix Makefiles" -a "${CORES}" != "" ]; then + BUILDER=(make -j ${CORES}) +else + BUILDER=("${CMAKE}" --build .) +fi + +env PATH="${BUILD_PATH}" "${BUILDER[@]}" |