Changeset View
Standalone View
share/mk/googletest.test.inc.mk
- This file was added.
# $FreeBSD: projects/import-googletest-1.8.1/share/mk/googletest.test.inc.mk 344457 2019-02-22 04:52:12Z ngie $ | # $FreeBSD: head/share/mk/googletest.test.inc.mk 344457 2019-02-22 04:52:12Z ngie $ | ||||
# XXX: this should be defined in bsd.sys.mk | |||||
CXXSTD?= c++11 | |||||
GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 | GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 | ||||
GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 | GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 | ||||
GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 | GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 | ||||
GTESTS_CXXFLAGS+= -frtti | GTESTS_CXXFLAGS+= -frtti | ||||
GTESTS_CXXFLAGS+= -std=c++11 | GTESTS_CXXFLAGS+= -std=${CXXSTD} | ||||
asomers: Why do you have to specify `-std=c++11`? What happens if you don't? Clang defaults to the… | |||||
Done Inline Actionsgoogletest compiles with -std=c++11 right now. I will made this optional via CXXSTD, like I suggested to @dim a while (2 years or so) ago, and will work on shuffling the value/flag setting over to bsd.sys.mk, etc. ngie: googletest compiles with `-std=c++11` right now. I will made this optional via `CXXSTD`, like I… | |||||
Not Done Inline ActionsAre you saying that googletest itself requires -std=c++11? or that any googletest client needs c++11 at a minimum? asomers: Are you saying that googletest itself requires `-std=c++11`? or that any googletest client… | |||||
Done Inline ActionsMostly the latter, however, newer versions of the spec might break functionality developed and tested with c++11 (very unlikely, but possible). ngie: Mostly the latter, however, newer versions of the spec might break functionality developed and… | |||||
Done Inline ActionsOk, but why put it in this file instead of bsd.sys.mk ? asomers: Ok, but why put it in this file instead of bsd.sys.mk ? | |||||
Done Inline ActionsI hadn’t gotten around to figuring out the appropriate format for putting it in there. I’ll work on it in parallel with this though. ngie: I hadn’t gotten around to figuring out the appropriate format for putting it in there. I’ll… | |||||
Done Inline ActionsThe reason why this matters is that PowerPC and mips are both still built with gcc 4.2.1, which will require a lower language spec version than clang and not all versions of clang support the C++11 spec. ngie: The reason why this matters is that PowerPC and mips are both still built with gcc 4.2.1, which… | |||||
Not Done Inline ActionsAhh, that would explain why you put it in this file, because PowerPC and mips don't use this file. asomers: Ahh, that would explain why you put it in this file, because PowerPC and mips don't use this… | |||||
# XXX: src.libnames.mk should handle adding this directory. | # XXX: src.libnames.mk should handle adding this directory. | ||||
GTESTS_CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private | GTESTS_CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private | ||||
NO_WTHREAD_SAFETY= | NO_WTHREAD_SAFETY= |
Why do you have to specify -std=c++11? What happens if you don't? Clang defaults to the gnu++14. With this in there, I have to manually add -std=c++14 to my own makefile.