1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(build): Add option to enable ThreadSanitizer

This commit is contained in:
Anthony Bilinski 2021-03-18 16:02:32 -07:00
parent 2d6fe8ee59
commit be167c9229
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -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})