Use at least 2 cores

release/4.3a0
Frank Dellaert 2022-02-17 00:10:04 -05:00
parent 5905110342
commit b65c89c159
1 changed files with 10 additions and 2 deletions

View File

@ -95,7 +95,11 @@ function build ()
configure configure
if [ "$(uname)" == "Linux" ]; then if [ "$(uname)" == "Linux" ]; then
make -j$(nproc) if (($(nproc) > 2)); then
make -j$(nproc)
else
make -j2
fi
elif [ "$(uname)" == "Darwin" ]; then elif [ "$(uname)" == "Darwin" ]; then
make -j$(sysctl -n hw.physicalcpu) make -j$(sysctl -n hw.physicalcpu)
fi fi
@ -113,7 +117,11 @@ function test ()
# Actual testing # Actual testing
if [ "$(uname)" == "Linux" ]; then if [ "$(uname)" == "Linux" ]; then
make -j$(nproc) check if (($(nproc) > 2)); then
make -j$(nproc) check
else
make -j2 check
fi
elif [ "$(uname)" == "Darwin" ]; then elif [ "$(uname)" == "Darwin" ]; then
make -j$(sysctl -n hw.physicalcpu) check make -j$(sysctl -n hw.physicalcpu) check
fi fi