Add MK_GOOGLETEST option for building/installing gmock/gtest

These libraries don't compile on non-C++-11 capable compilers, e.g., g++ 4.2.1
and its corresponding implementation of the c++ library, i.e., libstdc++.

Blacklist compilation on all non-C++-11 capable compilers and give others the
option of opting out of building/installing gmock/gtest via MK_GOOGLETEST.

This option is controlled by MK_CXX and MK_TESTS, as ATF compilation is.
This commit is contained in:
Enji Cooper 2019-02-19 22:40:32 +00:00
parent 0cd3ea4138
commit 43e25f47a7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/import-googletest-1.8.1/; revision=344312
4 changed files with 19 additions and 2 deletions

View file

@ -169,6 +169,7 @@ _libcplusplus+= libc++fs
.endif
SUBDIR.${MK_EFI}+= libefivar
SUBDIR.${MK_GOOGLETEST}+= googletest
SUBDIR.${MK_LIBTHR}+= libthr
SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh
SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s
@ -200,7 +201,6 @@ SUBDIR.${MK_RADIUS_SUPPORT}+= libradius
SUBDIR.${MK_SENDMAIL}+= libmilter libsm libsmdb libsmutil
SUBDIR.${MK_TELNET}+= libtelnet
SUBDIR.${MK_TESTS_SUPPORT}+= atf
SUBDIR.${MK_TESTS_SUPPORT}+= googletest
SUBDIR.${MK_TESTS}+= tests
SUBDIR.${MK_UNBOUND}+= libunbound
SUBDIR.${MK_USB}+= libusbhid libusb

View file

@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.\" $FreeBSD$
.Dd February 15, 2019
.Dd February 19, 2019
.Dt SRC.CONF 5
.Os
.Sh NAME
@ -529,6 +529,8 @@ When set, it enforces these options:
.It
.Va WITHOUT_GNUCXX
.It
.Va WITHOUT_GOOGLETEST
.It
.Va WITHOUT_LLVM_COV
.It
.Va WITHOUT_TESTS
@ -807,6 +809,11 @@ Set to not build GNU
Set this option to include GNU extensions in
.Xr bsdgrep 1
by linking against libgnuregex.
.It Va WITHOUT_GOOGLETEST
Set to not build nor install
.Lb libgmock ,
.Lb libgtest ,
and dependent tests.
.It Va WITHOUT_GPIO
Set to not build
.Xr gpioctl 8
@ -1784,6 +1791,8 @@ When set, it enforces these options:
.Bl -item -compact
.It
.Va WITHOUT_DTRACE_TESTS
.It
.Va WITHOUT_GOOGLETEST
.El
.Pp
When set, these options are also in effect:

View file

@ -108,6 +108,7 @@ __DEFAULT_YES_OPTIONS = \
GDB \
GNU_DIFF \
GNU_GREP \
GOOGLETEST \
GPIO \
HAST \
HTML \
@ -423,6 +424,7 @@ MK_${var}:= no
# Order is somewhat important.
#
.if !${COMPILER_FEATURES:Mc++11}
MK_GOOGLETEST:= no
MK_LLVM_LIBUNWIND:= no
.endif
@ -505,6 +507,7 @@ MK_FREEBSD_UPDATE:= no
.if ${MK_TESTS} == "no"
MK_DTRACE_TESTS:= no
MK_GOOGLETEST:= no
.endif
.if ${MK_ZONEINFO} == "no"

View file

@ -0,0 +1,5 @@
.\" $FreeBSD$
Set to not build nor install
.Lb libgmock ,
.Lb libgtest ,
and dependent tests.