Skip to content

Commit

Permalink
Fix build.sh missing nproc error in build for macOS (drogonframework#751
Browse files Browse the repository at this point in the history
)
  • Loading branch information
roq3 authored Mar 13, 2021
1 parent 1dfaaac commit df04c47
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ make_flags=''
cmake_gen=''
parallel=1

if [ $(uname) = 'FreeBSD' ]; then
nproc=$(sysctl -n hw.ncpu)
else
nproc=$(nproc)
fi
case $(uname) in
FreeBSD)
nproc=$(sysctl -n hw.ncpu)
;;
Darwin)
nproc=$(sysctl -n hw.ncpu) # sysctl -n hw.ncpu is the equivalent to nproc on macOS.
;;
*)
nproc=$(nproc)
;;
esac

# simulate ninja's parallelism
case nproc in
Expand All @@ -88,4 +94,4 @@ if [ "$1" = "-t" ]; then
build_drogon 1
else
build_drogon 0
fi
fi

0 comments on commit df04c47

Please sign in to comment.