svn commit: r321815 - projects/runtime-coverage/share/mk

Ngie Cooper ngie at FreeBSD.org
Mon Jul 31 20:28:27 UTC 2017


Author: ngie
Date: Mon Jul 31 20:28:26 2017
New Revision: 321815
URL: https://svnweb.freebsd.org/changeset/base/321815

Log:
  - Check CXXFLAGS as well for -g options before writing off --coverage support
    to enable c++ program runtime coverage instrumentation.
  - Pass --coverage down through LDFLAGS to ensure that libprofile_rt is used in
    the linking phase, for reasons similar to what I did with SOLINKOPTS in
    bsd.lib.mk at r321778.

Modified:
  projects/runtime-coverage/share/mk/bsd.prog.mk

Modified: projects/runtime-coverage/share/mk/bsd.prog.mk
==============================================================================
--- projects/runtime-coverage/share/mk/bsd.prog.mk	Mon Jul 31 20:15:11 2017	(r321814)
+++ projects/runtime-coverage/share/mk/bsd.prog.mk	Mon Jul 31 20:28:26 2017	(r321815)
@@ -43,10 +43,12 @@ CFLAGS+= -g
 CXXFLAGS+= -g
 CTFFLAGS+= -g
 .endif
-.if ${MK_COVERAGE} != "no" && ${CFLAGS:M-g*} != ""
+.if ${MK_COVERAGE} != "no" && \
+    (${CFLAGS:M-g*} != "" || ${CXXFLAGS:M-g*})
 _COV_FLAG= --coverage
 CFLAGS+= ${_COV_FLAG}
 CXXFLAGS+= ${_COV_FLAG}
+LDFLAGS+= ${_COV_FLAG}
 .endif
 .endif
 


More information about the svn-src-projects mailing list