diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-12-05 17:45:05 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-12-07 16:32:39 +0200 |
commit | 6d425f8a7e7e4d210bd6e81d656245d0b1b80266 (patch) | |
tree | fdd59cbcf0ab96ced85067bdc6f062728931c2c1 | |
parent | 07a9e26e8ac07cc9f454d9f6759e069ec1173c81 (diff) | |
download | qtlocation-mapboxgl-6d425f8a7e7e4d210bd6e81d656245d0b1b80266.tar.gz |
[build] Detect unsigned-integer-overflow and implicit-conversion
This is a defined behavior but often unintentional.
-rw-r--r-- | next/CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/next/CMakeLists.txt b/next/CMakeLists.txt index f869f48685..797a7e28f7 100644 --- a/next/CMakeLists.txt +++ b/next/CMakeLists.txt @@ -35,8 +35,14 @@ option(MBGL_WITH_SANITIZER "Use [address|thread|memory|undefined] here" OFF) set(CMAKE_CXX_FLAGS_DEBUGCOVERAGE "${CMAKE_CXX_FLAGS_DEBUG} --coverage") set(CMAKE_C_FLAGS_DEBUGCOVERAGE "${CMAKE_C_FLAGS_DEBUG} --coverage") -set(CMAKE_CXX_FLAGS_SANITIZE "-DSANITIZE -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=${MBGL_WITH_SANITIZER}") -set(CMAKE_C_FLAGS_SANITIZE "-DSANITIZE -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=${MBGL_WITH_SANITIZER}") +set( + CMAKE_CXX_FLAGS_SANITIZE + "-DSANITIZE -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=implicit-conversion -fsanitize=unsigned-integer-overflow -fsanitize=${MBGL_WITH_SANITIZER}" +) +set( + CMAKE_C_FLAGS_SANITIZE + "-DSANITIZE -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=implicit-conversion -fsanitize=unsigned-integer-overflow -fsanitize=${MBGL_WITH_SANITIZER}" +) add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti> |