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:
parent
2d6fe8ee59
commit
be167c9229
|
@ -29,6 +29,7 @@ option(USE_CCACHE "Use ccache when available" ON)
|
||||||
option(SPELL_CHECK "Enable spell cheching support" ON)
|
option(SPELL_CHECK "Enable spell cheching support" ON)
|
||||||
option(SVGZ_ICON "Compress the SVG icon of qTox" ON)
|
option(SVGZ_ICON "Compress the SVG icon of qTox" ON)
|
||||||
option(ASAN "Compile with AddressSanitizer" OFF)
|
option(ASAN "Compile with AddressSanitizer" OFF)
|
||||||
|
option(TSAN "Compile with ThreadSanitizer" OFF)
|
||||||
option(DESKTOP_NOTIFICATIONS "Use snorenotify for desktop notifications" OFF)
|
option(DESKTOP_NOTIFICATIONS "Use snorenotify for desktop notifications" OFF)
|
||||||
option(STRICT_OPTIONS "Enable strict compile options, used by CI" 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")
|
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
endif()
|
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}
|
set(ENV{PKG_CONFIG_PATH}
|
||||||
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user