]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix up CXXSTD support originally added in r345708
authorEnji Cooper <ngie@FreeBSD.org>
Mon, 22 Apr 2019 18:40:46 +0000 (18:40 +0000)
committerEnji Cooper <ngie@FreeBSD.org>
Mon, 22 Apr 2019 18:40:46 +0000 (18:40 +0000)
commitdb933d76bb02f19347b706717ff7e70044d0a5fa
tree521202fb7fe2556474779cca8132e3511567c8ec
parent59a05bdf354d7c3caf5f249f55b1496ac1324270
Fix up CXXSTD support originally added in r345708

r345708 worked for the base system, but unfortunately, caused a lot of
disruption for third-party packages that relied on C++, since bsd.sys.mk is
used by applications outside the base system. The defaults picked didn't match
the compiler's defaults and broke some builds that didn't specify a standard,
as well as some that overrode the value by setting `-std=gnu++14` (for
example) manually.

This change takes a more relaxed approach to appending `-std=${CXXSTD}` to
CXXFLAGS, by only doing so when the value is specified, as opposed to
overriding the standard set by an end-user. This avoids the need for having
to bake NOP default into bsd.sys.mk for supported compiler-toolchain
versions.

In order to make this change possible, add CXXSTD to Makefile snippets which
relied on the default value (c++11) added in r345708.

MFC after:      2 weeks
MFC with:       r345708, r346574
Reviewed by:    emaste
Reported by:    jbeich
Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change)
share/mk/bsd.sys.mk
share/mk/googletest.test.inc.mk