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])
40
40
m4_include ( [ build/autotools/AutoHarden.m4] )
41
41
m4_include ( [ build/autotools/MaintainerFlags.m4] )
42
42
m4_include ( [ build/autotools/Optimizations.m4] )
43
+ m4_include ( [ build/autotools/Coverage.m4] )
43
44
m4_include ( [ build/autotools/LDVersionScript.m4] )
44
45
45
46
# 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 = \
15
15
-DMONGOC_COMPILATION \
16
16
$(LIBC_FEATURES ) \
17
17
$(OPTIMIZE_CFLAGS ) \
18
+ $(COVERAGE_CFLAGS ) \
18
19
-I$(top_srcdir ) /src \
19
20
-I$(top_srcdir ) /src/mongoc \
20
21
-I$(top_builddir ) /src/mongoc \
@@ -34,7 +35,7 @@ libmongoc_priv_la_CPPFLAGS = $(MONGOC_CPPFLAGS_SHARED)
34
35
libmongoc_1_0_la_CPPFLAGS = $(MONGOC_CPPFLAGS_SHARED )
35
36
36
37
37
- MONGOC_LDFLAGS_SHARED = $(OPTIMIZE_LDFLAGS )
38
+ MONGOC_LDFLAGS_SHARED = $(OPTIMIZE_LDFLAGS ) $( COVERAGE_LDFLAGS )
38
39
libmongoc_priv_la_LDFLAGS = \
39
40
$(MONGOC_LDFLAGS_SHARED ) \
40
41
-no-undefined
You can’t perform that action at this time.
0 commit comments