mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(build): add option to enable AddressSanitizer
This commit is contained in:
parent
a2c44cbeda
commit
fd99dfd0a5
|
@ -13,11 +13,17 @@ option(USE_FILTERAUDIO "Enable the echo canceling backend" ON)
|
||||||
option(AUTOUPDATE "Enable the auto updater" OFF)
|
option(AUTOUPDATE "Enable the auto updater" OFF)
|
||||||
option(USE_CCACHE "Use ccache when available" ON)
|
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(ASAN "Compile with AddressSanitizer" OFF)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ASAN)
|
||||||
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
|
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
|
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