diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-01-23 19:43:15 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-02-07 05:05:11 +0000 |
commit | dec23d4f669f0d7106130622f690c1fcfedaddba (patch) | |
tree | 6f957102bac46190ef88780b8a7fc8b98d98d486 | |
parent | f2470f1a278f4d131e01daa9b9fe4361dafa664a (diff) |
build-options: add SANITIZERS build typeicefish_9.0.4icefish_9.0.3icefish_9.0.2icefish_9.0.1icefish_9.0.0icefish/9.0.4icefish/9.0.3icefish/9.0.2icefish/9.0.1icefish/9.0.09.0.49.0.39.0.29.0.19.0.0icefish
Add SANITIZERS build type for using AddressSanitizers to find
various memory corruptions within applications.
Bug-AGL: SPEC-3040
Change-Id: If430177cbac452c09d710a885cbe802419f13e6b
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r-- | src/cmake/cmake.d/01-build_options.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmake/cmake.d/01-build_options.cmake b/src/cmake/cmake.d/01-build_options.cmake index bbbd280..9b93d80 100644 --- a/src/cmake/cmake.d/01-build_options.cmake +++ b/src/cmake/cmake.d/01-build_options.cmake @@ -104,6 +104,12 @@ set(COVERAGE_COMPILE_OPTIONS -O0 --coverage CACHE STRING "Compilation flags for COVERAGE build type.") +set(SANITIZERS_COMPILE_OPTIONS + -g + -O0 + -fsanitize=address + -fno-omit-frame-pointer + CACHE STRING "Compilation flags for SANITIZERS build type.") set(RELEASE_COMPILE_OPTIONS -O2 -D_FORTIFY_SOURCE=2 @@ -118,6 +124,9 @@ endforeach() foreach(option ${COVERAGE_COMPILE_OPTIONS}) add_compile_options($<$<CONFIG:COVERAGE>:${option}>) endforeach() +foreach(option ${SANITIZERS_COMPILE_OPTIONS}) + add_compile_options($<$<CONFIG:SANITIZERS>:${option}>) +endforeach() foreach(option ${RELEASE_COMPILE_OPTIONS}) add_compile_options($<$<CONFIG:RELEASE>:${option}>) endforeach() @@ -144,6 +153,9 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG AND USE_EFENCE) IF(${CMAKE_BUILD_TYPE} MATCHES COVERAGE) list (APPEND link_libraries -coverage) ENDIF(${CMAKE_BUILD_TYPE} MATCHES COVERAGE) +IF(${CMAKE_BUILD_TYPE} MATCHES SANITIZERS) + list (APPEND link_libraries -fsanitize=address) +ENDIF(${CMAKE_BUILD_TYPE} MATCHES SANITIZERS) # set default include directories INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_DIRS}) |