From 43bba89656cce89964f260d46f2550ab9af00c9e Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 27 Apr 2018 11:33:22 -0400 Subject: build: Always compile module support for tests The --disable-module-* configure option removes code from the final binary but we still build the unit tests with the disable module(s) so we can actually test that code path all the time and not forget about it. Signed-off-by: David Goulet --- src/or/include.am | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/or/include.am') diff --git a/src/or/include.am b/src/or/include.am index 93f405d619..bb505937ac 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -114,20 +114,23 @@ LIBTOR_A_SOURCES = \ # # Modules are conditionnally compiled in tor starting here. We add the C files -# only if the modules has been enabled at configure time. +# only if the modules has been enabled at configure time. We always add the +# source files of every module to libtor-testing.a so we can build the unit +# tests for everything. # # The Directory Authority module. -if BUILD_MODULE_DIRAUTH -LIBTOR_A_SOURCES += \ +MODULE_DIRAUTH_SOURCES = \ src/or/dirauth/dircollate.c \ src/or/dirauth/dirvote.c \ src/or/dirauth/shared_random.c \ src/or/dirauth/shared_random_state.c +if BUILD_MODULE_DIRAUTH +LIBTOR_A_SOURCES += $(MODULE_DIRAUTH_SOURCES) endif src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES) -src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES) +src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES) $(MODULE_DIRAUTH_SOURCES) src_or_tor_SOURCES = src/or/tor_main.c AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or -- cgit v1.2.3-54-g00ecf