mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
Merge pull request #23567 from tchaikov/wip-cmake-cleanup
cmake: fix Debug build `WITH_SEASTAR=ON` Reviewed-by: Casey Bodley <cbodley@redhat.com> Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
This commit is contained in:
commit
0d209b6c21
@ -1,6 +1,6 @@
|
||||
if(NOT Sanitizers_FIND_COMPONENTS)
|
||||
set(Sanitizers_FIND_COMPONENTS
|
||||
address undefined-behavior)
|
||||
address undefined_behavior)
|
||||
endif()
|
||||
if(HAVE_JEMALLOC)
|
||||
message(WARNING "JeMalloc does not work well with sanitizers")
|
||||
@ -10,26 +10,23 @@ set(Sanitizers_OPTIONS)
|
||||
|
||||
foreach(component ${Sanitizers_FIND_COMPONENTS})
|
||||
if(component STREQUAL "address")
|
||||
set(Sanitizers_Address_COMPILE_OPTIONS "address")
|
||||
list(APPEND Sanitizers_OPTIONS "address")
|
||||
set(Sanitizers_address_COMPILE_OPTIONS "address")
|
||||
elseif(component STREQUAL "leak")
|
||||
set(Sanitizers_Leak_COMPILE_OPTIONS "leak")
|
||||
list(APPEND Sanitizers_OPTIONS "leak")
|
||||
set(Sanitizers_leak_COMPILE_OPTIONS "leak")
|
||||
elseif(component STREQUAL "thread")
|
||||
if ("Address" IN_LIST ${Sanitizers_FIND_COMPONENTS} OR
|
||||
"Leak" IN_LIST ${Sanitizers_FIND_COMPONENTS})
|
||||
if ("address" IN_LIST ${Sanitizers_FIND_COMPONENTS} OR
|
||||
"leak" IN_LIST ${Sanitizers_FIND_COMPONENTS})
|
||||
message(SEND_ERROR "Cannot combine -fsanitize-leak w/ -fsanitize-thread")
|
||||
elseif(NOT CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
message(SEND_ERROR "TSan requires all code to be position independent")
|
||||
endif()
|
||||
set(Sanitizers_Thread_COMPILE_OPTIONS "thread")
|
||||
list(APPEND Sanitizers_OPTIONS "thread")
|
||||
elseif(component STREQUAL "undefined-behavior")
|
||||
set(Sanitizers_Undefined-Behavior_COMPILE_OPTIONS "undefined")
|
||||
list(APPEND Sanitizers_OPTIONS "undefined")
|
||||
elseif(component STREQUAL "undefined_behavior")
|
||||
set(Sanitizers_undefined_behavior_COMPILE_OPTIONS "undefined")
|
||||
else()
|
||||
message(SEND_ERROR "Unsupported sanitizer: ${component}")
|
||||
endif()
|
||||
list(APPEND Sanitizers_OPTIONS "${Sanitizers_${component}_COMPILE_OPTIONS}")
|
||||
endforeach()
|
||||
|
||||
if(Sanitizers_OPTIONS)
|
||||
|
Loading…
Reference in New Issue
Block a user