Fix determining the number of logical CPUs under macOS

Use sysctrl instead of nproc which doesn't exist under Mac.
This commit is contained in:
Vadim Zeitlin
2021-06-26 12:54:19 +02:00
parent 32f2a679b4
commit a5cf7f3479

View File

@@ -119,7 +119,21 @@ jobs:
run: |
echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV
wxPROC_COUNT=`nproc`
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
echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV