From 19161c5a95bdcb3130df10410ab0b36e29c8d589 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Sep 2022 11:49:17 +0100 Subject: [PATCH] [Minor] Respect full debug request in sanitizers config --- cmake/Sanitizer.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/Sanitizer.cmake b/cmake/Sanitizer.cmake index 58a240f6f..b13e418e3 100644 --- a/cmake/Sanitizer.cmake +++ b/cmake/Sanitizer.cmake @@ -4,9 +4,17 @@ option (SANITIZE "Enable sanitizer: address, memory, undefined, leak (comma sepa set (SAN_FLAGS "${SAN_FLAGS} -g -fno-omit-frame-pointer -DSANITIZER") # O1 is normally set by clang, and -Og by gcc if (COMPILER_GCC) - set (SAN_FLAGS "${SAN_FLAGS} -Og") + if (ENABLE_FULL_DEBUG MATCHES "ON") + set (SAN_FLAGS "${SAN_FLAGS} -O0") + else() + set (SAN_FLAGS "${SAN_FLAGS} -Og") + endif() else () - set (SAN_FLAGS "${SAN_FLAGS} -O1") + if (ENABLE_FULL_DEBUG MATCHES "ON") + set (SAN_FLAGS "${SAN_FLAGS} -O0") + else() + set (SAN_FLAGS "${SAN_FLAGS} -O1") + endif() endif () if (SANITIZE) if (ENABLE_JEMALLOC MATCHES "ON") -- 2.39.5