diff options
author | Janek Bevendorff <janek@jbev.net> | 2017-03-14 16:29:09 +0300 |
---|---|---|
committer | Janek Bevendorff <janek@jbev.net> | 2017-03-15 17:23:44 +0300 |
commit | 65d4a0a8cd5c59ebdd36a20f9f70f174acf5867d (patch) | |
tree | 94e8f85fdcd1bb806771bb9c1b2e08db802c2138 /CMakeLists.txt | |
parent | 30847570bc48ba2fef7dd246f4e27a2f9c69a90d (diff) |
Add ASAN option to CMake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ef1743df7..2ea0fc8f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ include(CheckCXXSourceCompiles) option(WITH_TESTS "Enable building of unit tests" ON) option(WITH_GUI_TESTS "Enable building of GUI tests" OFF) option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated methods." OFF) +option(WITH_ASAN "Enable address sanitizer checks" OFF) option(WITH_COVERAGE "Use to build with coverage tests. (GCC ONLY)." OFF) option(WITH_XC_AUTOTYPE "Include Auto-Type." ON) @@ -83,6 +84,9 @@ endif() add_gcc_compiler_cxxflags("-fno-exceptions -fno-rtti") add_gcc_compiler_cxxflags("-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual") add_gcc_compiler_cflags("-Wchar-subscripts -Wwrite-strings") +if(WITH_ASAN) + add_gcc_compiler_flags("-fsanitize=address") +endif() string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)") |