From: Kefu Chai Date: Sun, 17 Mar 2024 10:53:03 +0000 (+0800) Subject: cmake: quote a list using quotes X-Git-Tag: testing/wip-batrick-testing-20240411.154038~105^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ce444d473ce0fd178e7df2984f147f46e0dbf921;p=ceph-ci.git cmake: quote a list using quotes otherwised we'd have ``` CMake Error at cmake/modules/FindSanitizers.cmake:17 (if): if given arguments: "address" "IN_LIST" "address" "thread" "undefined_behavior" "OR" "leak" "IN_LIST" "address" "thread" "undefined_behavior" Unknown arguments specified ``` when enabling TSan with WITH_TSAN=ON. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/FindSanitizers.cmake b/cmake/modules/FindSanitizers.cmake index bfb99821a9b..1401ca2442b 100644 --- a/cmake/modules/FindSanitizers.cmake +++ b/cmake/modules/FindSanitizers.cmake @@ -14,8 +14,8 @@ foreach(component ${Sanitizers_FIND_COMPONENTS}) elseif(component STREQUAL "leak") set(Sanitizers_leak_COMPILE_OPTIONS "-fsanitize=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")