[hitori/wip/pwithnall/macros: 3/8] build: Use AX_CODE_COVERAGE



commit d61ce10a116f3d04006b23b2a15b8a8cf8f17fae
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Mar 11 12:42:20 2015 +0000

    build: Use AX_CODE_COVERAGE
    
    Port the existing code coverage support to AX_CODE_COVERAGE. It is now
    controlled by --enable-code-coverage, rather than --enable-debug.
    
    https://wiki.gnome.org/Projects/GnomeCommon/Migration

 Makefile.am  |   12 ++++++------
 configure.ac |    3 +++
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 588b3b2..b418ab7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,15 +29,15 @@ src_hitori_CPPFLAGS = \
 src_hitori_LDADD = $(GENERAL_LIBS)
 src_hitori_CFLAGS = \
        $(GENERAL_CFLAGS) \
+       $(CODE_COVERAGE_CFLAGS) \
        $(WARN_CFLAGS) \
        $(NULL)
-
-if DEBUG
-src_hitori_CFLAGS += \
-       -fprofile-arcs \
-       -ftest-coverage \
+src_hitori_LDFLAGS = \
+       $(CODE_COVERAGE_LDFLAGS) \
        $(NULL)
-endif
+
+# Code coverage
+ CODE_COVERAGE_RULES@
 
 # Icons
 icon_dir = $(datadir)/icons/hicolor
diff --git a/configure.ac b/configure.ac
index abffa16..b29137b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,9 @@ GNOME_MAINTAINER_MODE_DEFINES
 AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debugging]),[debug=$enableval],[debug=no])
 AM_CONDITIONAL([DEBUG],[test "$debug" = "yes"])
 
+# Code coverage
+AX_CODE_COVERAGE()
+
 # GResources
 AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources])
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]