Skip to content

Commit

Permalink
Add ASAN option to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
phoerious committed Mar 15, 2017
1 parent 3084757 commit 65d4a0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)")
Expand Down

0 comments on commit 65d4a0a

Please sign in to comment.