]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: quote a list using quotes
authorKefu Chai <tchaikov@gmail.com>
Sun, 17 Mar 2024 10:53:03 +0000 (18:53 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 26 Mar 2024 23:35:28 +0000 (07:35 +0800)
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 <tchaikov@gmail.com>
cmake/modules/FindSanitizers.cmake

index bfb99821a9bd51aa79837e835052d74eed7dcd7b..1401ca2442bf475e1ad482457ceb1ee5f3b4375a 100644 (file)
@@ -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")