Browse Source

feat(build): Add option to enable ThreadSanitizer

reviewable/pr6321/r1
Anthony Bilinski 5 years ago
parent
commit
be167c9229
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 6
      CMakeLists.txt

6
CMakeLists.txt

@ -29,6 +29,7 @@ option(USE_CCACHE "Use ccache when available" ON) @@ -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) @@ -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})

Loading…
Cancel
Save