use O1 with thread sanitizer

This commit is contained in:
daan 2020-07-22 12:45:53 -07:00
parent 341048f61e
commit 529d74a282

View File

@ -137,7 +137,7 @@ endif()
if(MI_DEBUG_TSAN MATCHES "ON") if(MI_DEBUG_TSAN MATCHES "ON")
if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_C_COMPILER_ID MATCHES "Clang")
message(STATUS "Build with thread sanitizer (MI_DEBUG_TSAN=ON)") message(STATUS "Build with thread sanitizer (MI_DEBUG_TSAN=ON)")
list(APPEND mi_cflags -fsanitize=thread -g) list(APPEND mi_cflags -fsanitize=thread -g -O1)
list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=thread) list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=thread)
else() else()
message(WARNING "Can only use thread sanitizer with clang (MI_DEBUG_TSAN=ON but ignored)") message(WARNING "Can only use thread sanitizer with clang (MI_DEBUG_TSAN=ON but ignored)")