Skip to content

Commit

Permalink
[Minor] Respect full debug request in sanitizers config
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Sep 19, 2022
1 parent 9af2911 commit 19161c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmake/Sanitizer.cmake
Expand Up @@ -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")
Expand Down

0 comments on commit 19161c5

Please sign in to comment.