From: Kefu Chai Date: Thu, 8 Jan 2026 23:43:13 +0000 (+0800) Subject: cmake: guard unittest_global_doublefree with WITH_LIBCEPHFS X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F66848%2Fhead;p=ceph.git cmake: guard unittest_global_doublefree with WITH_LIBCEPHFS The unittest_global_doublefree test detects double-free issues in global static variables when an executable links both librados and libcephfs. However, it was incorrectly guarded by WITH_CEPHFS (which controls the server-side cephfs components) instead of WITH_LIBCEPHFS (which controls the client library it actually depends on). This causes build failures when building with WITH_LIBCEPHFS enabled but WITH_CEPHFS disabled: ``` /usr/bin/ld: cannot find -lcephfs: No such file or directory ``` Change the guard to WITH_LIBCEPHFS to match the actual dependency. While this scenario is uncommon (most users enable WITH_CEPHFS), the fix correctly aligns the build logic with the test's dependencies. Signed-off-by: Kefu Chai --- diff --git a/src/test/common/CMakeLists.txt b/src/test/common/CMakeLists.txt index 7624abf2dee..50ebf9166c1 100644 --- a/src/test/common/CMakeLists.txt +++ b/src/test/common/CMakeLists.txt @@ -316,13 +316,13 @@ add_ceph_unittest(unittest_perf_counters_key) target_link_libraries(unittest_perf_counters_key ceph-common) # unittest_global_doublefree -if(WITH_CEPHFS) +if(WITH_LIBCEPHFS) add_executable(unittest_global_doublefree test_global_doublefree.cc ) add_ceph_unittest(unittest_global_doublefree) target_link_libraries(unittest_global_doublefree cephfs librados ceph-common) -endif(WITH_CEPHFS) +endif() if(NOT WIN32) add_executable(unittest_dns_resolve