Enable ubsan and tsan by default only if it's a debug build

This commit is contained in:
blankie 2023-01-25 12:38:12 +07:00
parent c46c7778b6
commit 68e30aa968
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 5 additions and 1 deletions

View File

@ -31,12 +31,16 @@ set(SOURCES main.cpp event_loop.cpp logcat_thread.cpp logcat_entry.cpp log.cpp c
set(IMGUI_SOURCES imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_widgets.cpp imgui/imgui_tables.cpp set(IMGUI_SOURCES imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui_widgets.cpp imgui/imgui_tables.cpp
imgui/misc/cpp/imgui_stdlib.cpp imgui/misc/freetype/imgui_freetype.cpp imgui/misc/cpp/imgui_stdlib.cpp imgui/misc/freetype/imgui_freetype.cpp
imgui/backends/imgui_impl_sdl.cpp imgui/backends/imgui_impl_opengl3.cpp) imgui/backends/imgui_impl_sdl.cpp imgui/backends/imgui_impl_opengl3.cpp)
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SOURCES ${SOURCES} windows/debug.cpp) set(SOURCES ${SOURCES} windows/debug.cpp)
set(IMGUI_SOURCES ${IMGUI_SOURCES} imgui/imgui_demo.cpp) set(IMGUI_SOURCES ${IMGUI_SOURCES} imgui/imgui_demo.cpp)
if ("${FLAGS}" STREQUAL "")
set(FLAGS "-fsanitize=undefined,thread")
endif()
endif() endif()
set(FLAGS "-fsanitize=undefined,thread -DIMGUI_USER_CONFIG='\"../myimconfig.h\"'") set(FLAGS "${FLAGS} -DIMGUI_USER_CONFIG='\"../myimconfig.h\"'")
# https://t.me/NightShadowsHangout/670691 # https://t.me/NightShadowsHangout/670691
set(FLAGS "${FLAGS} -Werror -Wall -Wextra -Wshadow -Wpedantic -Wno-gnu-anonymous-struct -fno-rtti -fPIC -Wconversion -Wno-unused-parameter -Wimplicit-fallthrough") set(FLAGS "${FLAGS} -Werror -Wall -Wextra -Wshadow -Wpedantic -Wno-gnu-anonymous-struct -fno-rtti -fPIC -Wconversion -Wno-unused-parameter -Wimplicit-fallthrough")
# https://sourceforge.net/p/valgrind/mailman/valgrind-users/thread/Ygze8PzaQAYWlKDj%40wildebeest.org/ # https://sourceforge.net/p/valgrind/mailman/valgrind-users/thread/Ygze8PzaQAYWlKDj%40wildebeest.org/