This change accomplishes the following items:
- Make libgtest require pthread support.
- Stop building static copies of the libraries.
- Do not install gtest-config.
- Build the upstream-provided tests.
Make libgtest require pthread support
As noted by @asomers in rS300906 (cddl/usr.sbin/zfsd/tests/Makefile
specifically), googletest requires libpthread in order to function, if
-DGTEST_HAS_PTHREAD is defined.
While this is true, the code was not being linked against libpthread,
resulting in libgtest being broken, and thus all tests reliant on the library
broken at runtime.
Long story short, the integration logic in googletest/m4/acx_pthread.m4 is
broken. Switching to cmake unbreaks using googletest out of the box .
Stop building static copies of the libraries
For whatever reason, the maintainers thought it was best to build either with
shared or static libraries, but not both. Switching to cmake makes this an
Do not install gtest-config
Using gtest-config when building from a GitHub clone results in incorrect
behavior, as it looks up the headers in /usr/local/include before the
headers in the local clone, making local builds with installed copies of
Build the upstream-provided tests
A number of tests are available with the gtest project. In order to do a
compare and contrast between the work I started as far as importing the
project to base, I needed to build/run them.
PR: 236169