Add check for making valgrind and asan mutually exclusive.
@@ -47,7 +47,12 @@ endif()
# Set memory check configuration
option(OPTION_TEST_MEMORYCHECK "Run tests with memory checker (valgrind)." OFF)
-if(OPTION_TEST_MEMORYCHECK)
+
+if(OPTION_TEST_MEMORYCHECK AND OPTION_BUILD_SANITIZER)
+ message(WARNING "OPTION_TEST_MEMORYCHECK and OPTION_BUILD_SANITIZER are not compatible, disabling memcheck tests.")
+endif()
+
+if(OPTION_TEST_MEMORYCHECK AND NOT OPTION_BUILD_SANITIZER)
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --leak-check=full")
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --trace-children=yes")
set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-reachable=yes")
