4 . ci/get-nprocessors.sh
6 # if possible, ask for the precise number of processors,
7 # otherwise take 2 processors as reasonable default; see
8 # https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization
9 if [ -x /usr/bin/getconf ]; then
10 NPROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
14 # as of 2017-09-04 Travis CI reports 32 processors, but GCC build
15 # crashes if parallelized too much (maybe memory consumption problem),
16 # so limit to 4 processors for the time being.
17 if [ $NPROCESSORS -gt 4 ] ; then
18 echo "$0:Note: Limiting processors to use by make from $NPROCESSORS to 4."
21 # Tell make to use the processors. No preceding '-' required.
22 MAKEFLAGS="j${NPROCESSORS}"
27 # Set default values to OFF for these variables if not specified.
28 : "${NO_EXCEPTION:=OFF}"
30 : "${COMPILER_IS_GNUCXX:=OFF}"
34 cmake -Dgtest_build_samples=ON \
35 -Dgtest_build_tests=ON \
36 -Dgmock_build_tests=ON \
37 -Dcxx_no_exception=$NO_EXCEPTION \
38 -Dcxx_no_rtti=$NO_RTTI \
39 -DCMAKE_COMPILER_IS_GNUCXX=$COMPILER_IS_GNUCXX \
40 -DCMAKE_CXX_FLAGS=$CXX_FLAGS \
41 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
44 CTEST_OUTPUT_ON_FAILURE=1 make test