From 0b5798fac6dc68cbfa15f146f69e0fb71833ec45 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 10 Sep 2023 13:23:49 -0400 Subject: [PATCH] update tests, add sanatizers --- CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa9ded1..9927fbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,4 +14,19 @@ file(GLOB_RECURSE source_files src/*.cpp) add_executable(BLT_TESTS ${source_files}) -target_link_libraries(BLT_TESTS BLT_GRAPHICS) \ No newline at end of file +target_link_libraries(BLT_TESTS private BLT_GRAPHICS) + +if (${ENABLE_ADDRSAN} MATCHES ON) + target_compile_options(BLT_GRAPHICS PRIVATE -fsanitize=address) + target_link_options(BLT_GRAPHICS PRIVATE -fsanitize=address) +endif () + +if (${ENABLE_UBSAN} MATCHES ON) + target_compile_options(BLT_GRAPHICS PRIVATE -fsanitize=undefined) + target_link_options(BLT_GRAPHICS PRIVATE -fsanitize=undefined) +endif () + +if (${ENABLE_TSAN} MATCHES ON) + target_compile_options(BLT_GRAPHICS PRIVATE -fsanitize=thread) + target_link_options(BLT_GRAPHICS PRIVATE -fsanitize=thread) +endif () \ No newline at end of file