mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Add sanitizers for cmake (#2608)
These can be enabled using the `SANITIZE_{ADDRESS,MEMORY,THREAD,UNDEFINED}` cmake flags
This commit is contained in:
parent
1a1cea9542
commit
208d017cc3
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -25,3 +25,6 @@
|
|||
[submodule "lib/websocketpp"]
|
||||
path = lib/websocketpp
|
||||
url = https://github.com/ziocleto/websocketpp
|
||||
[submodule "cmake/sanitizers-cmake"]
|
||||
path = cmake/sanitizers-cmake
|
||||
url = https://github.com/arsenm/sanitizers-cmake
|
||||
|
|
|
@ -4,6 +4,7 @@ include(FeatureSummary)
|
|||
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${CMAKE_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/sanitizers-cmake/cmake"
|
||||
)
|
||||
|
||||
project(chatterino VERSION 2.2.3)
|
||||
|
@ -44,6 +45,8 @@ if (WIN32)
|
|||
find_package(WinToast REQUIRED)
|
||||
endif ()
|
||||
|
||||
find_package(Sanitizers)
|
||||
|
||||
# Find boost on the system
|
||||
find_package(Boost REQUIRED)
|
||||
|
||||
|
|
1
cmake/sanitizers-cmake
Submodule
1
cmake/sanitizers-cmake
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 99e159ec9bc8dd362b08d18436bd40ff0648417b
|
|
@ -460,6 +460,7 @@ endif ()
|
|||
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${SOURCE_FILES})
|
||||
|
||||
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
|
||||
add_sanitizers(${PROJECT_NAME})
|
||||
|
||||
target_precompile_headers(${PROJECT_NAME} PRIVATE PrecompiledHeader.hpp)
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ add_executable(${PROJECT_NAME}
|
|||
${chatterino_SOURCES}
|
||||
${test_SOURCES}
|
||||
)
|
||||
add_sanitizers(${PROJECT_NAME})
|
||||
|
||||
# Enable autogeneration of Qts MOC/RCC/UIC
|
||||
set_target_properties(${PROJECT_NAME}
|
||||
|
|
Loading…
Reference in a new issue