diff options
author | Stepan Khapugin <stkhapugin@users.noreply.github.com> | 2017-09-07 15:44:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-07 15:44:18 +0200 |
commit | e43a5948d51edbb78595c30d6fd1db6736156ddf (patch) | |
tree | 754430bde6e9da802aa2bb07b54a51b8ed983fdc /travis.sh | |
parent | 9a8794faed3c6a7c80205122d73d93dcb376dd57 (diff) | |
parent | a33b6b091999d44f771761be03beb64d3af2350a (diff) | |
download | googletest-e43a5948d51edbb78595c30d6fd1db6736156ddf.tar.gz googletest-e43a5948d51edbb78595c30d6fd1db6736156ddf.tar.bz2 googletest-e43a5948d51edbb78595c30d6fd1db6736156ddf.zip |
Merge branch 'master' into master
Diffstat (limited to 'travis.sh')
-rwxr-xr-x | travis.sh | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,5 +1,25 @@ #!/usr/bin/env sh set -evx + +# if possible, ask for the precise number of processors, +# otherwise take 2 processors as reasonable default; see +# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization +if [ -x /usr/bin/getconf ]; then + NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN) +else + NPROCESSORS=2 +fi +# as of 2017-09-04 Travis CI reports 32 processors, but GCC build +# crashes if parallelized too much (maybe memory consumption problem), +# so limit to 4 processors for the time being. +if [ $NPROCESSORS -gt 4 ] ; then + echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4." + NPROCESSORS=4 +fi +# Tell make to use the processors. No preceding '-' required. +MAKEFLAGS="j${NPROCESSORS}" +export MAKEFLAGS + env | sort mkdir build || true |