summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-12-05 17:45:05 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-12-05 21:39:09 +0200
commit4213a526a225bab7ba91a45134825e2c074fdc1f (patch)
tree53d3f5526d0ab34cfedeb65311027e475143f32c
parent9c92d3d85da822dfc64e2b61dca6e5ea6bcd437d (diff)
downloadqtlocation-mapboxgl-upstream/tmpsantos-do_not_halt_ubsan.tar.gz
[build] Detect unsigned-integer-overflow and implicit-conversionupstream/tmpsantos-do_not_halt_ubsan
This is a defined behavior but often unintentional.
-rw-r--r--next/CMakeLists.txt10
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>