summary refs log tree commit diff stats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rw-r--r--ci/funs.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/ci/funs.sh b/ci/funs.sh
index 8e7f8faf7..026366198 100644
--- a/ci/funs.sh
+++ b/ci/funs.sh
@@ -58,7 +58,11 @@ _nimNumCpu(){
   # FreeBSD | macOS: $(sysctl -n hw.ncpu)
   # OpenBSD: $(sysctl -n hw.ncpuonline)
   # windows: $NUMBER_OF_PROCESSORS ?
-  echo $(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || 1)
+  if env | grep -q '^NIMCORES='; then
+    echo $NIMCORES
+  else
+    echo $(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || 1)
+  fi
 }
 
 _nimBuildCsourcesIfNeeded(){