mdbx-cmake: add ENABLE_UBSAN option.

Change-Id: Ic4333f28aa6494be24c7be1f396bd069dcb9bb5d
This commit is contained in:
Leonid Yuriev 2020-07-03 01:55:42 +03:00
parent 2ee45b1820
commit 500fed496c
2 changed files with 7 additions and 0 deletions

View File

@ -651,6 +651,10 @@ macro(setup_compile_flags)
add_compile_flags("C;CXX" -fsanitize=address)
endif()
if(ENABLE_UBSAN)
add_compile_flags("C;CXX" -fsanitize=undefined)
endif()
if(ENABLE_GCOV)
if(NOT HAVE_GCOV)
message(FATAL_ERROR

View File

@ -42,4 +42,7 @@ endif()
option(ENABLE_ASAN
"Enable AddressSanitizer, a fast memory error detector based on compiler instrumentation" OFF)
option(ENABLE_UBSAN
"Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector based on compiler instrumentation" OFF)
cmake_policy(POP)