Modify CXXFLAGS, not just CFLAGS in test/Makefile ENGINE-259
authorDamiano Boppart <damiano@pep-security.net>
Tue, 19 Sep 2017 15:01:05 +0200
branchENGINE-259
changeset 207592b8a67735e0
parent 2074 817d6f5e8f48
child 2076 2aadece6fcf4
child 2724 aa90c046a552
Modify CXXFLAGS, not just CFLAGS in test/Makefile
build-config/common.conf
test/Makefile
     1.1 --- a/build-config/common.conf	Tue Sep 19 14:50:07 2017 +0200
     1.2 +++ b/build-config/common.conf	Tue Sep 19 15:01:05 2017 +0200
     1.3 @@ -35,6 +35,8 @@
     1.4  
     1.5  ######### C++ #########
     1.6  #CXX This option is platform-specific
     1.7 +# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
     1.8 +# The tests do not work properly, if compiled with -DNDEBUG
     1.9  #CXXFLAGS This option is platform-specific
    1.10  
    1.11  ######### C and C++ #########
     2.1 --- a/test/Makefile	Tue Sep 19 14:50:07 2017 +0200
     2.2 +++ b/test/Makefile	Tue Sep 19 15:01:05 2017 +0200
     2.3 @@ -58,13 +58,19 @@
     2.4  UNIT_TESTS_RUN=$(subst .cc,_run,$(UNIT_TESTS_SOURCE))
     2.5  
     2.6  CFLAGS:=$(filter-out -DNDEBUG,$(CFLAGS))
     2.7 -
     2.8  ifneq ($(MAKECMDGOALS),clean)
     2.9      ifneq (,$(findstring -DNDEBUG,$(CFLAGS)))
    2.10          $(error The macro NDEBUG must not be defined for test compilation.)
    2.11      endif
    2.12  endif
    2.13  
    2.14 +CXXFLAGS:=$(filter-out -DNDEBUG,$(CXXFLAGS))
    2.15 +ifneq ($(MAKECMDGOALS),clean)
    2.16 +    ifneq (,$(findstring -DNDEBUG,$(CXXFLAGS)))
    2.17 +        $(error The macro NDEBUG must not be defined for test compilation.)
    2.18 +    endif
    2.19 +endif
    2.20 +
    2.21  .PHONY: all
    2.22  all: $(TARGET) $(UNIT_TESTS)
    2.23