Skip to content

Commit fb5294a

Browse files
committed
cmake: explicitly link unittest_rocksdb_option against RocksDB
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 <[email protected]>
1 parent 548e252 commit fb5294a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/objectstore/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ add_executable(unittest_rocksdb_option
6262
$<TARGET_OBJECTS:unit-main>
6363
)
6464
add_ceph_unittest(unittest_rocksdb_option)
65-
target_link_libraries(unittest_rocksdb_option global os ${BLKID_LIBRARIES})
65+
target_link_libraries(unittest_rocksdb_option
66+
global os ${BLKID_LIBRARIES}
67+
RocksDB::RocksDB)
6668

6769
# ceph_test_bluefs (a clone of unittest_bluefs)
6870
add_executable(ceph_test_bluefs

0 commit comments

Comments
 (0)