Add a CXXWARNFLAGS variable

Some warning flags are valid for C++ but not C. GCC 8 complains if you pass
such flags when building a C file. Using a separate variable for these
flags allows building both C and C++ files in the same directory (such as
the fusefs tests) under GCC.

Reviewed by:	cem, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21116
This commit is contained in:
Alan Somers 2019-07-30 19:34:39 +00:00
parent 305b9efefc
commit 6b184f622a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350453

View File

@ -234,6 +234,8 @@ DEBUG_FILES_CFLAGS?= -g
.if ${MK_WARNS} != "no"
CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}}
CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}
CXXFLAGS+= ${CXXWARNFLAGS:M*} ${CXXWARNFLAGS.${COMPILER_TYPE}}
CXXFLAGS+= ${CXXWARNFLAGS.${.IMPSRC:T}}
.endif
CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}