From ce444d473ce0fd178e7df2984f147f46e0dbf921 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 17 Mar 2024 18:53:03 +0800 Subject: [PATCH] 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 --- cmake/modules/FindSanitizers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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") -- 2.39.5