]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: dedup components when finding pmem 40578/head
authorKefu Chai <kchai@redhat.com>
Sat, 3 Apr 2021 13:59:05 +0000 (21:59 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 5 Apr 2021 09:33:10 +0000 (17:33 +0800)
otherwise we always find libpmem twice if libpmem is explicitly
specified when find_package()

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Findpmem.cmake

index def31cb1ff28e1456957f25330e5cbcc072c93d5..1f6e9eab0f559364b5118491adfdf7a6bd23ee90 100644 (file)
@@ -6,7 +6,11 @@
 
 find_package(PkgConfig QUIET REQUIRED)
 
-foreach(component pmem ${pmem_FIND_COMPONENTS})
+# all pmem libraries depend on pmem, so always find it
+set(pmem_FIND_COMPONENTS ${pmem_FIND_COMPONENTS} pmem)
+list(REMOVE_DUPLICATES pmem_FIND_COMPONENTS)
+
+foreach(component ${pmem_FIND_COMPONENTS})
   set(pmem_COMPONENTS pmem pmemobj)
   list(FIND pmem_COMPONENTS "${component}" found)
   if(found EQUAL -1)