Allow to limit number of cores used for compilation
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Rafal Kupiec 2022-07-23 16:53:39 +02:00
parent ae00ff07a1
commit bfa6974cfc
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 6 additions and 4 deletions

View File

@ -2,4 +2,4 @@ pipeline:
build:
image: codingworkshop/oscw-runner:latest
commands:
- ./build-linux.sh
- CORES=8 ./build-linux.sh

View File

@ -508,9 +508,11 @@ xtchain_build()
set -e
# Check number of CPU cores available
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
: ${CORES:=$(nproc 2>/dev/null)}
: ${CORES:=1}
if [[ ! -n ${CORES} ]]; then
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
: ${CORES:=$(nproc 2>/dev/null)}
: ${CORES:=1}
fi
# Create working directories
mkdir -p ${BINDIR}