diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f7c7fe87..5f2ae141 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,6 @@ if (BUILD_TESTING) FetchContent_MakeAvailable("Catch2") add_compile_definitions("CATCH_CONFIG_NO_COUNTER") - set(CATCH_TEST_ARGS "EXTRA_ARGS" "--reporter" "junit::out=junit.xml" "--reporter" "console::out=-::colour-mode=ansi") endif() #[============================================================================[ @@ -41,6 +40,7 @@ endif() option(TEACHOS_ENABLE_LINTING "Enable linting during build" ON) option(TEACHOS_GENERATE_DOCS "Generate documentation during build" ON) +option(TEACHOS_ENABLE_TEST_SANITIZERS "Enable sanitizers for test executables" ON) #[============================================================================[ # Global Build System Configuration @@ -106,6 +106,11 @@ if(BUILD_TESTING) CXX_CLANG_TIDY "" ) endif() + + if(TEACHOS_ENABLE_TEST_SANITIZERS) + add_compile_options("$<$<CXX_COMPILER_ID:GNU>:-fsanitize=undefined,address>") + add_link_options("$<$<CXX_COMPILER_ID:GNU>:-fsanitize=undefined,address,leak>") + endif() endif() #[============================================================================[ |
