aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 394f5bf..5f2ae14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,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,8 +107,10 @@ if(BUILD_TESTING)
)
endif()
- add_compile_options("$<$<CXX_COMPILER_ID:GNU>:-fsanitize=undefined,address>")
- add_link_options("$<$<CXX_COMPILER_ID:GNU>:-fsanitize=undefined,address>")
+ 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()
#[============================================================================[