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 | |
parent | Merge pull request #1430 from dlrobertson/nvidia_drm (diff) | |
download | sway-3d209be3d64081ee47f39d7e494830a73b178a72.tar.gz sway-3d209be3d64081ee47f39d7e494830a73b178a72.tar.zst sway-3d209be3d64081ee47f39d7e494830a73b178a72.zip |
Add Address Sanitized build type
- Add -DCMAKE_BUILD_TYPE=ASAN to possible builds
-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: | |||
6 | - gcc | 6 | - gcc |
7 | - clang | 7 | - clang |
8 | 8 | ||
9 | env: | ||
10 | - BUILD_TYPE=Release | ||
11 | - BUILD_TYPE=Debug | ||
12 | - BUILD_TYPE=ASAN | ||
13 | |||
9 | arch: | 14 | arch: |
10 | packages: | 15 | packages: |
11 | - cmake | 16 | - cmake |
@@ -19,7 +24,7 @@ arch: | |||
19 | - wlc-git | 24 | - wlc-git |
20 | - libcap | 25 | - libcap |
21 | script: | 26 | script: |
22 | - "cmake ." | 27 | - "cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ." |
23 | - "make" | 28 | - "make" |
24 | 29 | ||
25 | script: | 30 | script: |
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) | |||
9 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) | 9 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) |
10 | add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) | 10 | add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) |
11 | 11 | ||
12 | # Add Address Sanitiezed build type | ||
13 | set(CMAKE_C_FLAGS_ASAN | ||
14 | "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer" | ||
15 | CACHE STRING "Flags used by the C compiler during address sanitizer builds." | ||
16 | FORCE ) | ||
17 | mark_as_advanced( | ||
18 | CMAKE_C_FLAGS_ASAN | ||
19 | CMAKE_EXE_LINKER_FLAGS_DEBUG | ||
20 | CMAKE_SHARED_LINKER_FLAGS_DEBUG | ||
21 | ) | ||
22 | |||
12 | list(INSERT CMAKE_MODULE_PATH 0 | 23 | list(INSERT CMAKE_MODULE_PATH 0 |
13 | ${CMAKE_CURRENT_SOURCE_DIR}/CMake | 24 | ${CMAKE_CURRENT_SOURCE_DIR}/CMake |
14 | ) | 25 | ) |