Skip to content

Commit

Permalink
Merge pull request swiftlang#108 from manyoso/linux_parallel
Browse files Browse the repository at this point in the history
Query linux for number of processing units for make parallelism
  • Loading branch information
gribozavr committed Dec 3, 2015
2 parents 074cb8e + f4c3412 commit bbab40a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,19 @@ function to_varname() {
}

function get_make_parallelism() {
if [ "$(uname -s)" == "Darwin" ] ; then
sysctl -n hw.activecpu
else
echo 8
fi
case "$(uname -s)" in
Linux)
nproc
;;

Darwin)
sysctl -n hw.activecpu
;;

*)
echo 8
;;
esac
}

function get_dsymutil_parallelism() {
Expand Down

0 comments on commit bbab40a

Please sign in to comment.