mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-08-03 20:57:55 -04:00
add ENDABLE_UBSAN CMake option (#2155)
This commit is contained in:
parent
cec33c2631
commit
a8e1749cef
@ -99,6 +99,16 @@ if(ENABLE_ASAN)
|
||||
_checked_add_link_option(-fsanitize=address)
|
||||
endif()
|
||||
|
||||
option(ENABLE_UBSAN "Enable UBSan" OFF)
|
||||
if(ENABLE_UBSAN)
|
||||
# Set -Werror to catch "argument unused during compilation" warnings.
|
||||
# Also needs to be a link flag for test to pass.
|
||||
set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize=undefined")
|
||||
_checked_add_compile_option(-fsanitize=undefined)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
_checked_add_link_option(-fsanitize=undefined)
|
||||
endif()
|
||||
|
||||
option(ENABLE_TSAN "Enable TSan" OFF)
|
||||
if(ENABLE_TSAN)
|
||||
# Set -Werror to catch "argument unused during compilation" warnings.
|
||||
|
Loading…
x
Reference in New Issue
Block a user