summary refs log tree commit diff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-04 18:11:03 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-04 18:11:03 +0300
commitb47007d59aa803331dc0c5e515d9a6f69e51c01e (patch)
tree4f4016ce6ba3c6a97cf47e225ae786d16dd4d1f0 /CMakeLists.txt
parentFetch user avatars while browsing the member list (diff)
downloadnheko-b47007d59aa803331dc0c5e515d9a6f69e51c01e.tar.xz
Add compile option for address sanitizers
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e808dd4..a199713d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 3.1)
 
 option(APPVEYOR_BUILD "Build on appveyor" OFF)
+option(ASAN "Compile with address sanitizers" OFF)
 
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
@@ -311,6 +312,10 @@ set(NHEKO_DEPS
     ${TRANSLATION_DEPS}
     ${META_FILES_TO_INCLUDE})
 
+if(ASAN)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
+endif()
+
 if(APPLE)
     add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
     target_link_libraries (nheko ${NHEKO_LIBS} Qt5::MacExtras Qt5::Multimedia)