win32*.sh: Use nproc for CPU count when targeting win32

When building in chroot jail, /proc/cpuinfo may not be available. Switch to
nproc which should be widely available, and does not rely on /proc/cpuinfo.

Signed-off-by: Mike Latimer <mlatimer@suse.com>
This commit is contained in:
Mike Latimer 2020-03-26 20:14:52 -06:00 committed by Lucian Petrut
parent 95ccc1c283
commit 6c57f6b2c2
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ set -o pipefail
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
num_vcpus=$(( $(lscpu -p | tail -1 | cut -d "," -f 1) + 1 ))
num_vcpus=$(nproc)
CEPH_DIR="${CEPH_DIR:-$SCRIPT_DIR}"
BUILD_DIR="${BUILD_DIR:-${CEPH_DIR}/build}"

View File

@ -5,7 +5,7 @@ set -e
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
num_vcpus=$(( $(lscpu -p | tail -1 | cut -d "," -f 1) + 1 ))
num_vcpus=$(nproc)
NUM_WORKERS=${NUM_WORKERS:-$num_vcpus}
DEPS_DIR="${DEPS_DIR:-$SCRIPT_DIR/build.deps}"