Skip to content

Commit

Permalink
support macOS and linux for getting CPU count
Browse files Browse the repository at this point in the history
  • Loading branch information
brarcher committed Mar 31, 2018
1 parent 5403d4b commit 862cd64
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ fi
ANDROID_API_VERSION=9
NDK_TOOLCHAIN_ABI_VERSION=4.8

NUMBER_OF_CORES=$(sysctl -n hw.ncpu)
NUMBER_OF_CORES=1
which nproc >/dev/null
if [ $? -eq 0 ]; then
NUMBER_OF_CORES=$(nproc)
fi
if [ $NUMBER_OF_CORES -eq 1 ]; then
# Attempt to determine cores if running on macOS
which sysctl >/dev/null
if [ $? -eq 0 ]; then
NUMBER_OF_CORES=$(sysctl -n hw.ncpu)
fi
fi

HOST_UNAME=$(uname -m)
TARGET_OS=linux

Expand Down

0 comments on commit 862cd64

Please sign in to comment.