diff options
| author | Dan Robertson <danlrobertson89@gmail.com> | 2017-10-26 14:07:36 +0000 |
|---|---|---|
| committer | Dan Robertson <dan.robertson@anidata.org> | 2017-10-27 03:25:30 +0000 |
| commit | 3d209be3d64081ee47f39d7e494830a73b178a72 (patch) | |
| tree | 4a488b2db79dd53e54fa739f7bd764c08178fa1a /CMakeLists.txt | |
| parent | d75ee3f9ce1e7143375252cc86aeccbbc752599b (diff) | |
Add Address Sanitized build type
- Add -DCMAKE_BUILD_TYPE=ASAN to possible builds
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b253f1fc..36763005 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,17 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) +# Add Address Sanitiezed build type +set(CMAKE_C_FLAGS_ASAN + "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer" + CACHE STRING "Flags used by the C compiler during address sanitizer builds." + FORCE ) +mark_as_advanced( + CMAKE_C_FLAGS_ASAN + CMAKE_EXE_LINKER_FLAGS_DEBUG + CMAKE_SHARED_LINKER_FLAGS_DEBUG + ) + list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/CMake ) |
