diff options
author | Frank Busse <bb0xfb@gmail.com> | 2018-10-03 14:17:28 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-10-10 18:58:09 +0100 |
commit | 44892ef160e9a6cb471ecbf100d45cfc5e65f8e6 (patch) | |
tree | e366f701e98aad928c402e3a12325c0bda0a8b01 /CMakeLists.txt | |
parent | 4feadfd9a3049cbfe2f986dc96b69dbe10bbf2ed (diff) | |
download | klee-44892ef160e9a6cb471ecbf100d45cfc5e65f8e6.tar.gz |
cmake/lit: add asan/non-asan, ubsan/non-ubsan flags
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e894aec..b1830954 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -607,6 +607,22 @@ else() endif() ################################################################################ +# Sanitizer support +################################################################################ +message(STATUS "${CMAKE_CXX_FLAGS}") +set(IS_ASAN_BUILD 0) +set(IS_UBSAN_BUILD 0) +string(REPLACE " " ";" _flags ${CMAKE_CXX_FLAGS}) +foreach(arg IN ITEMS ${_flags}) + if (${arg} STREQUAL -fsanitize=address) + set(IS_ASAN_BUILD 1) + elseif (${arg} STREQUAL -fsanitize=undefined) + set(IS_UBSAN_BUILD 1) + endif() +endforeach() +unset(_flags) + +################################################################################ # Generate `config.h` ################################################################################ configure_file(${CMAKE_SOURCE_DIR}/include/klee/Config/config.h.cmin |