sanitizer: add an option to enable various sanitizers
This commit is contained in:
parent
9198bae72d
commit
878a1f118f
1
nc.cmake
1
nc.cmake
@ -14,6 +14,7 @@ find_package (Threads REQUIRED)
|
||||
link_libraries (Threads::Threads)
|
||||
|
||||
include (nc_cxx)
|
||||
include (nc_sanitizer)
|
||||
include (nc_platform)
|
||||
include (nc_optimisation)
|
||||
include (nc_warnings)
|
||||
|
14
nc_sanitizer.cmake
Normal file
14
nc_sanitizer.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
option (SANITIZER "enable sanitizers" OFF)
|
||||
|
||||
if (SANITIZER)
|
||||
append_compile_flag("-fsanitize=undefined")
|
||||
append_compile_flag("-fsanitize=address")
|
||||
append_compile_flag("-fsanitize=leak")
|
||||
|
||||
append_compile_flag("--param max-gcse-memory=167772160")
|
||||
|
||||
append_compile_flag("-fsanitize=pointer-compare")
|
||||
append_compile_flag("-fsanitize=pointer-subtract")
|
||||
|
||||
add_definitions("-D_GLIBCXX_SANITIZE_VECTOR")
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user