File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1+ COVERAGE_CFLAGS=""
2+ COVERAGE_LDFLAGS=""
3+
4+ if test "$enable_coverage" = "yes"; then
5+ COVERAGE_CFLAGS="--coverage -g"
6+ COVERAGE_LDFLAGS="-lgcov"
7+ fi
8+
9+ AC_SUBST ( COVERAGE_CFLAGS )
10+ AC_SUBST ( COVERAGE_LDFLAGS )
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ m4_include([build/autotools/FindDependencies.m4])
4040m4_include ( [ build/autotools/AutoHarden.m4] )
4141m4_include ( [ build/autotools/MaintainerFlags.m4] )
4242m4_include ( [ build/autotools/Optimizations.m4] )
43+ m4_include ( [ build/autotools/Coverage.m4] )
4344m4_include ( [ build/autotools/LDVersionScript.m4] )
4445
4546# We would put AM_INIT_AUTOMAKE into SetupAutomake.m4, but seems to cause
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ MONGOC_CPPFLAGS_SHARED = \
1515 -DMONGOC_COMPILATION \
1616 $(LIBC_FEATURES ) \
1717 $(OPTIMIZE_CFLAGS ) \
18+ $(COVERAGE_CFLAGS ) \
1819 -I$(top_srcdir ) /src \
1920 -I$(top_srcdir ) /src/mongoc \
2021 -I$(top_builddir ) /src/mongoc \
@@ -34,7 +35,7 @@ libmongoc_priv_la_CPPFLAGS = $(MONGOC_CPPFLAGS_SHARED)
3435libmongoc_1_0_la_CPPFLAGS = $(MONGOC_CPPFLAGS_SHARED )
3536
3637
37- MONGOC_LDFLAGS_SHARED = $(OPTIMIZE_LDFLAGS )
38+ MONGOC_LDFLAGS_SHARED = $(OPTIMIZE_LDFLAGS ) $( COVERAGE_LDFLAGS )
3839libmongoc_priv_la_LDFLAGS = \
3940 $(MONGOC_LDFLAGS_SHARED ) \
4041 -no-undefined
You can’t perform that action at this time.
0 commit comments