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