Add script to determine proc count in CI

This commit is contained in:
Maarten Bent
2021-07-21 22:32:03 +02:00
parent 8fe396d890
commit 7446c64333
2 changed files with 19 additions and 17 deletions

View File

@@ -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"

18
build/tools/proc_count.sh Executable file
View File

@@ -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