mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Detect number of cores in build script
This commit is contained in:
parent
6f04f52f5c
commit
141b83228c
1 changed files with 8 additions and 2 deletions
10
b.sh
10
b.sh
|
@ -83,6 +83,13 @@ else
|
|||
BUILD_DIR="build"
|
||||
fi
|
||||
|
||||
CORES_COUNT=4
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
CORES_COUNT="$(nproc)"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
CORES_COUNT="$(sysctl -n hw.physicalcpu)"
|
||||
fi
|
||||
|
||||
# Strict errors. Any non-zero return exits this script
|
||||
set -e
|
||||
|
||||
|
@ -90,6 +97,5 @@ mkdir -p ${BUILD_DIR}
|
|||
pushd ${BUILD_DIR}
|
||||
|
||||
cmake $CMAKE_ARGS ..
|
||||
|
||||
make -j4 $MAKE_OPT
|
||||
make -j$CORES_COUNT $MAKE_OPT
|
||||
popd
|
||||
|
|
Loading…
Add table
Reference in a new issue