]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge a bunch of googletest build improvements
authorDimitry Andric <dim@FreeBSD.org>
Thu, 27 May 2021 18:45:13 +0000 (20:45 +0200)
committerDimitry Andric <dim@FreeBSD.org>
Thu, 27 May 2021 18:45:13 +0000 (20:45 +0200)
commitee5326013093ddf50cae165e66dda9d8ac092d97
tree7f22f865f36013ba487deefc222dbaa21e33e15e
parent4234e5ee7644d610d061eb33515a2a4a88e2b7a1
Merge a bunch of googletest build improvements

googletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and later

Pick 711fccf8317b4fb7adc21c00fc1e20823c5d875f from upstream googletest:

    Don't allow signed/unsigned wchar_t in gcc 9 and later

Upstream pull request: https://github.com/google/googletest/pull/2270

Sponsored by: Dell EMC Isilon

(cherry picked from commit f157ca4696f5922275d5d451736005b9332eb136)

Major improvement to build parallelism for googletest internal tests

Currently the googletest internal tests build after the matching library.
However, each of these is serialized at the top level makefile.
Additionally some of the tests (e.g. the gmock-matches-test) take up to
90 seconds to build with clang -O2. Having to wait for this test to
complete before continuing to the next directory seriously slows down the
parllelism of a -j32 build.
Before this change running `make -C lib/googletest -j32 -s` in buildenv
took 202 seconds, now it's 153 due to improved parallelism.

Reviewed By: emaste (no objection)
Differential Revision: https://reviews.freebsd.org/D26748

(cherry picked from commit 2ed3236082a4473c1da8f72c1ebc071a7b54321f)

Enable SUBDIR_PARALLEL for lib/googletest

This saves a few seconds in a parallel build since we can build the
gtest_main and gmock subdirectories in parallel.

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D26760

(cherry picked from commit 4fa4bd6312cbeebda23a80feb77f29691af0cd7b)

Significantly reduce compile time for googletest internal tests

Clang's optimizer spends a really long time on these tests at -O2, so we now
use -O0 instead. This reduces the -j32 time for lib/googletest/test from 131s
to 29s. Using -O0 also reduces the disk usage from 144MB (at -O2) / 92MB (at
-O1) to 82MB.

Reviewed By: ngie, dim
Differential Revision: https://reviews.freebsd.org/D26751

(cherry picked from commit 433f33d285eee7cd6a822b9d833a537dfc808634)
12 files changed:
contrib/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h
lib/googletest/Makefile
lib/googletest/gmock/Makefile
lib/googletest/gmock_main/Makefile
lib/googletest/gtest/Makefile
lib/googletest/gtest_main/Makefile
lib/googletest/tests/Makefile
lib/googletest/tests/Makefile.inc [new file with mode: 0644]
lib/googletest/tests/gmock/Makefile [moved from lib/googletest/gmock/tests/Makefile with 100% similarity]
lib/googletest/tests/gmock_main/Makefile [moved from lib/googletest/gmock_main/tests/Makefile with 100% similarity]
lib/googletest/tests/gtest/Makefile [moved from lib/googletest/gtest/tests/Makefile with 100% similarity]
lib/googletest/tests/gtest_main/Makefile [moved from lib/googletest/gtest_main/tests/Makefile with 100% similarity]