mirror of
https://github.com/HerculesWS/Hercules
synced 2026-08-15 12:23:13 -04:00
Add missing options to linker for sanitized builds
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
This commit is contained in:
parent
b430aa85c0
commit
1d8a7b58f4
2 changed files with 3 additions and 0 deletions
|
|
@ -467,6 +467,7 @@ if(ENABLE_SANITIZE)
|
|||
message(FATAL_ERROR "Sanitizer Cannot be enabled on MSVC builds")
|
||||
endif()
|
||||
add_compile_definitions(SANITIZE)
|
||||
# skipped because server have multiple issues: -fsanitize=alignment
|
||||
testadd_sanitizer_flag(address)
|
||||
testadd_sanitizer_flag(shift)
|
||||
testadd_sanitizer_flag(integer-divide-by-zero)
|
||||
|
|
|
|||
|
|
@ -110,11 +110,13 @@ function(testadd_sanitizer_flag _name)
|
|||
check_c_compiler_flag("-fsanitize=${_name} -fsanitize-undefined-trap-on-error" SANITIZE_UNDEFINED_TRAP_CHECK)
|
||||
if(${SANITIZE_UNDEFINED_TRAP_CHECK})
|
||||
add_compile_options("-fsanitize=${_name} -fsanitize-undefined-trap-on-error")
|
||||
add_link_options("-fsanitize=${_name} -fsanitize-undefined-trap-on-error")
|
||||
elseif(${arg_REQUIRED})
|
||||
message(FATAL_ERROR "Sanitizer flag -fsanitize=${_name} is required")
|
||||
endif()
|
||||
else()
|
||||
add_compile_options("-fsanitize=${_name}")
|
||||
add_link_options("-fsanitize=${_name}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue