diff options
author | Herbert Thielen <thielen@hs-worms.de> | 2017-09-08 11:47:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 11:47:45 +0200 |
commit | 803ab9a860694e96e2c48784c12dbdee30447726 (patch) | |
tree | 09c3cd45aa96e9598b28965a2194fcc5ba41ce2a /travis.sh | |
parent | e8c6942ac1570c9598cf2d177f6c69cc5ab2bd7b (diff) | |
parent | 894cdb82cb2a1141bde8710a67ea4c5325d1d202 (diff) | |
download | googletest-803ab9a860694e96e2c48784c12dbdee30447726.tar.gz googletest-803ab9a860694e96e2c48784c12dbdee30447726.tar.bz2 googletest-803ab9a860694e96e2c48784c12dbdee30447726.zip |
Merge branch 'master' into hethi/remove-linker-warning-on-non-existing-path
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 |