Skip to content

Commit

Permalink
build-script: let distcc dictate parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Abrahams committed Feb 23, 2016
1 parent bf712c5 commit 887c3bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -1062,19 +1062,21 @@ else
)
fi


CMAKE_JOBS="${BUILD_JOBS}"
if [[ "${DISTCC}" ]] ; then
BUILD_ARGS="${BUILD_ARGS} -j $(distcc -j)"
CMAKE_JOBS="$(distcc -j)"
fi

case "${CMAKE_GENERATOR}" in
Ninja)
BUILD_ARGS="${BUILD_ARGS} -j${BUILD_JOBS}"
BUILD_ARGS="${BUILD_ARGS} -j${CMAKE_JOBS}"
if [[ "${VERBOSE_BUILD}" ]] ; then
BUILD_ARGS="${BUILD_ARGS} -v"
fi
;;
'Unix Makefiles')
BUILD_ARGS="${BUILD_ARGS} -j${BUILD_JOBS}"
BUILD_ARGS="${BUILD_ARGS} -j${CMAKE_JOBS}"
if [[ "${VERBOSE_BUILD}" ]] ; then
BUILD_ARGS="${BUILD_ARGS} VERBOSE=1"
fi
Expand All @@ -1084,7 +1086,7 @@ case "${CMAKE_GENERATOR}" in
# but since we're not using proper Xcode 4 schemes, this is the
# only way to get target-level parallelism.
BUILD_ARGS="${BUILD_ARGS} -parallelizeTargets"
BUILD_ARGS="${BUILD_ARGS} -jobs ${BUILD_JOBS}"
BUILD_ARGS="${BUILD_ARGS} -jobs ${CMAKE_JOBS}"
BUILD_TARGET_FLAG="-target"
COMMON_CMAKE_OPTIONS=(
"${COMMON_CMAKE_OPTIONS[@]}"
Expand Down

0 comments on commit 887c3bb

Please sign in to comment.