From 20b973825f5e45da7094244cb589adfb587761a1 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Tue, 13 May 2025 09:35:51 +0200 Subject: [PATCH] build: add `ENABLE_SANITIZER` for other sanitizer types --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e7e4a29..88eedba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -881,6 +881,13 @@ foreach(tgt dwarfs_test_helpers dwarfs_follybenchmark_lite -fno-omit-frame-pointer) target_link_options(${tgt} PRIVATE -fsanitize=undefined) endif() + + if(ENABLE_SANITIZER) + target_compile_options(${tgt} PRIVATE -fsanitize=${ENABLE_SANITIZER} + -fno-omit-frame-pointer) + target_link_options(${tgt} PRIVATE -fsanitize=${ENABLE_SANITIZER}) + endif() + endif() endforeach()