提交 a09defec 编写于 作者: M Max Bruckner

CMake: Add ENABLE_SANITIZERS flag

Enabling this flag enables AddressSanitizer and
UndefinedBehaviorSanitizer
上级 21c02cd3
......@@ -43,6 +43,21 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
)
endif()
option(ENABLE_SANITIZERS "Enables AddressSanitizer and UndefinedBehaviorSanitizer." OFF)
if (ENABLE_SANITIZERS)
list(APPEND custom_compiler_flags
-fno-omit-frame-pointer
-fsanitize=address
-fsanitize=undefined
-fsanitize=float-divide-by-zero
-fsanitize=float-cast-overflow
-fsanitize-address-use-after-scope
-fsanitize=integer
-01
-fno-sanitize-recover
)
endif()
# apply custom compiler flags
foreach(compiler_flag ${custom_compiler_flags})
#remove problematic characters
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册