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 <k.chai@proxmox.com>
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