summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-01-15 12:52:32 +0000
committerGitHub <noreply@github.com>2021-01-15 12:52:32 +0000
commit3392da3ce49853057288009367df3d48d9d0d6f9 (patch)
treece6b54f74f963886c0a686cbd37ac8365a97ecbc
parent674875dc7b1fc4a63cd2ac12a6aa2a534b003f2a (diff)
parent75888f273e9beae91e48e3490e50b4db9c208117 (diff)
downloadlibgit2-3392da3ce49853057288009367df3d48d9d0d6f9.tar.gz
Merge pull request #5780 from libgit2/ethomson/ci
ci: don't use ninja on macOS
-rw-r--r--.github/workflows/main.yml1
-rw-r--r--.github/workflows/nightly.yml1
-rwxr-xr-xci/build.sh13
3 files changed, 12 insertions, 3 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f101eda65..3d2102c21 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -153,7 +153,6 @@ jobs:
env:
CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
- CMAKE_GENERATOR: Ninja
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 2f56fdb7f..b52b398d8 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -112,7 +112,6 @@ jobs:
env:
CC: clang
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
- CMAKE_GENERATOR: Ninja
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
SKIP_SSH_TESTS: true
SKIP_NEGOTIATE_TESTS: true
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[@]}"