mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-14 15:36:47 +03:00
ninja: support disabling parallel building
but keep it enabled by default
This commit is contained in:
parent
9f8ec7e4d3
commit
2c7cd2455e
@ -4,9 +4,16 @@ ninjaBuildPhase() {
|
||||
if [[ -z "$ninjaFlags" && ! ( -e build.ninja ) ]]; then
|
||||
echo "no build.ninja, doing nothing"
|
||||
else
|
||||
local buildCores=1
|
||||
|
||||
# Parallel building is enabled by default.
|
||||
if [ "${enableParallelBuilding-1}" ]; then
|
||||
buildCores="$NIX_BUILD_CORES"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
local flagsArray=( \
|
||||
${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
|
||||
-j"$buildCores" -l"$NIX_BUILD_CORES" \
|
||||
$ninjaFlags "${ninjaFlagsArray[@]}" \
|
||||
$buildFlags "${buildFlagsArray[@]}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user