diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-27 08:46:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 08:46:29 -0400 |
commit | c57f68566a52d12f0fbfdfcfcfbf76aad861eb24 (patch) | |
tree | 52452b66a97098bb1d879c45d71ac514105ca1d2 | |
parent | ee6ed89e36f9c2ef1f57093e25bf5804ac6c856e (diff) | |
parent | 3d209be3d64081ee47f39d7e494830a73b178a72 (diff) | |
download | sway-c57f68566a52d12f0fbfdfcfcfbf76aad861eb24.tar.xz |
Merge pull request #1436 from dlrobertson/add_asan_build
Add Address Sanitized build type
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | CMakeLists.txt | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml index 69634765..3eeb1682 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,11 @@ compiler: - gcc - clang +env: + - BUILD_TYPE=Release + - BUILD_TYPE=Debug + - BUILD_TYPE=ASAN + arch: packages: - cmake @@ -19,7 +24,7 @@ arch: - wlc-git - libcap script: - - "cmake ." + - "cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ." - "make" script: diff --git a/CMakeLists.txt b/CMakeLists.txt index bf37d9df..bf373280 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 ) |