diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fd1db851a..d1e832e767 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,23 +119,7 @@ jobs: run: | echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV - case `uname` in - Linux) - wxPROC_COUNT=`nproc` - ;; - - Darwin) - wxPROC_COUNT=`sysctl -n hw.ncpu` - ;; - - *) - echo "*** Unknown platform: `uname` ***" - wxPROC_COUNT=0 - ;; - esac - - ((wxPROC_COUNT++)) - echo wxPROC_COUNT=$wxPROC_COUNT >> $GITHUB_ENV + wxPROC_COUNT=`./build/tools/proc_count.sh` echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV # Setting this variable suppresses "Error retrieving accessibility bus address" diff --git a/build/tools/proc_count.sh b/build/tools/proc_count.sh new file mode 100755 index 0000000000..f4a5565ecd --- /dev/null +++ b/build/tools/proc_count.sh @@ -0,0 +1,18 @@ +# This script outputs the number of available processors/cores plus one. + +case `uname` in + Linux) + wxPROC_COUNT=`nproc` + ;; + + Darwin) + wxPROC_COUNT=`sysctl -n hw.ncpu` + ;; + + *) + wxPROC_COUNT=0 + ;; +esac + +((wxPROC_COUNT++)) +echo $wxPROC_COUNT