Przeglądaj źródła

Merge pull request #2577 from yalpul/patch-1

CI: Make processor count consistent
Colin Edwards 5 lat temu
rodzic
commit
3b27eee20f
1 zmienionych plików z 2 dodań i 4 usunięć
  1. 2 4
      formatcode.sh

+ 2 - 4
formatcode.sh

@@ -14,10 +14,8 @@ set -o nounset
 # Get CPU count
 OS=$(uname)
 NPROC=1
-if [[ $OS = "Linux" ]] ; then
-    NPROC=$(nproc)
-elif [[ ${OS} = "Darwin" ]] ; then
-    NPROC=$(sysctl -n hw.physicalcpu)
+if [[ $OS = "Linux" || $OS = "Darwin" ]] ; then
+    NPROC=$(getconf _NPROCESSORS_ONLN)
 fi
 
 # Discover clang-format