diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f5434c1d..74e556f8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ option(USE_CCACHE "Use ccache when available" ON) option(SPELL_CHECK "Enable spell cheching support" ON) option(SVGZ_ICON "Compress the SVG icon of qTox" ON) option(ASAN "Compile with AddressSanitizer" OFF) +option(TSAN "Compile with ThreadSanitizer" OFF) option(DESKTOP_NOTIFICATIONS "Use snorenotify for desktop notifications" OFF) option(STRICT_OPTIONS "Enable strict compile options, used by CI" OFF) @@ -46,6 +47,11 @@ if(ASAN) set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") endif() +if(TSAN) + set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread") + set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=thread") +endif() + set(ENV{PKG_CONFIG_PATH} ${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})