From 046e738e762ce80e49b224902d918218d974285c 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 2d10518a..04613b06 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()