]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: explicitly link unittest_rocksdb_option against RocksDB
authorKefu Chai <tchaikov@gmail.com>
Tue, 17 Jun 2025 14:24:29 +0000 (22:24 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 18 Jun 2025 03:26:32 +0000 (11:26 +0800)
Previously, unittest_rocksdb_option relied on transitive RocksDB linkage
from the "os" dependency, which was fragile and implicit. Since
unittest_rocksdb_option directly uses RocksDB APIs (including rocksdb/db.h
in TestRocksdbOptionParse.cc), it should explicitly declare this dependency.

This change adds an explicit link to RocksDB::RocksDB, making the build
system more robust and self-contained.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/test/objectstore/CMakeLists.txt

index d72d99ec37ccba86fe7cd62afe697c0242695bb5..754aec71f1a204f1e83f032c3e46fe4c372073f0 100644 (file)
@@ -62,7 +62,9 @@ add_executable(unittest_rocksdb_option
   $<TARGET_OBJECTS:unit-main>
   )
 add_ceph_unittest(unittest_rocksdb_option)
-target_link_libraries(unittest_rocksdb_option global os ${BLKID_LIBRARIES})
+target_link_libraries(unittest_rocksdb_option
+  global os ${BLKID_LIBRARIES}
+  RocksDB::RocksDB)
 
 # ceph_test_bluefs (a clone of unittest_bluefs)
 add_executable(ceph_test_bluefs