Skip to content

Commit 40b43b9

Browse files
authored
Merge pull request ceph#63796 from tchaikov/wip-memstore-silence-warning
cmake: suppress -Wmaybe-uninitialized warning in memstore PageSet Reviewed-by: Matan Breizman <[email protected]>
2 parents 0f65bd2 + 3277f05 commit 40b43b9

File tree

8 files changed

+98
-71
lines changed

8 files changed

+98
-71
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,6 @@ if(WITH_TESTS)
873873
add_subdirectory(test)
874874
endif()
875875

876-
add_subdirectory(crypto)
877-
878876
if(WITH_TESTS)
879877
install(PROGRAMS
880878
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
@@ -1147,6 +1145,7 @@ if(WITH_RADOSGW)
11471145
endif(WITH_SYSTEM_ARROW)
11481146
endif(WITH_RADOSGW_SELECT_PARQUET OR WITH_RADOSGW_ARROW_FLIGHT)
11491147

1148+
add_subdirectory(crypto)
11501149
add_subdirectory(libkmip)
11511150
add_subdirectory(rgw)
11521151
endif(WITH_RADOSGW)

src/crypto/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
add_custom_target(crypto_plugins)
1+
# crypto plugins are loaded at runtime by rgw_crypt.cc
2+
add_custom_target(crypto_plugins ALL)
23
set(crypto_plugin_dir ${CEPH_INSTALL_PKGLIBDIR}/crypto)
34

45
add_subdirectory(openssl)

src/os/CMakeLists.txt

Lines changed: 26 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,51 @@
1-
set(libos_srcs
1+
add_library(os STATIC
22
ObjectStore.cc
3-
Transaction.cc
4-
memstore/MemStore.cc
5-
kstore/KStore.cc
6-
kstore/kstore_types.cc
7-
fs/FS.cc)
3+
Transaction.cc)
84

9-
if(WITH_BLUESTORE)
10-
list(APPEND libos_srcs
11-
bluestore/Allocator.cc
12-
bluestore/AllocatorBase.cc
13-
bluestore/BitmapFreelistManager.cc
14-
bluestore/BlueFS.cc
15-
bluestore/bluefs_types.cc
16-
bluestore/BlueRocksEnv.cc
17-
bluestore/BlueStore.cc
18-
bluestore/BlueStore_debug.cc
19-
bluestore/simple_bitmap.cc
20-
bluestore/bluestore_types.cc
21-
bluestore/fastbmap_allocator_impl.cc
22-
bluestore/FreelistManager.cc
23-
bluestore/StupidAllocator.cc
24-
bluestore/BitmapAllocator.cc
25-
bluestore/AvlAllocator.cc
26-
bluestore/BtreeAllocator.cc
27-
bluestore/Btree2Allocator.cc
28-
bluestore/HybridAllocator.cc
29-
bluestore/Writer.cc
30-
bluestore/Compression.cc
31-
bluestore/BlueAdmin.cc
32-
bluestore/BlueEnv.cc
33-
)
34-
endif(WITH_BLUESTORE)
35-
36-
if(WITH_FUSE)
37-
list(APPEND libos_srcs
38-
FuseStore.cc)
39-
endif(WITH_FUSE)
40-
41-
if(HAVE_LIBXFS)
42-
list(APPEND libos_srcs
43-
fs/XFS.cc)
44-
endif()
5+
target_link_libraries(os
6+
PRIVATE
7+
legacy-option-headers
8+
${FMT_LIB})
459

46-
add_library(os STATIC ${libos_srcs})
10+
add_subdirectory(memstore)
4711
target_link_libraries(os
48-
legacy-option-headers
49-
blk
50-
${FMT_LIB})
12+
PRIVATE memstore)
5113

52-
target_compile_definitions(os PRIVATE -DWITH_KSTORE)
53-
target_link_libraries(os heap_profiler kv)
14+
add_subdirectory(kstore)
15+
target_link_libraries(os
16+
PRIVATE
17+
kstore)
5418

55-
if(WITH_BLUEFS)
56-
add_library(bluefs SHARED
57-
bluestore/BlueRocksEnv.cc)
58-
target_include_directories(bluefs SYSTEM PUBLIC
59-
$<TARGET_PROPERTY:RocksDB::RocksDB,INTERFACE_INCLUDE_DIRECTORIES>)
60-
target_link_libraries(bluefs global)
61-
install(TARGETS bluefs DESTINATION lib)
62-
endif(WITH_BLUEFS)
19+
if(WITH_BLUESTORE)
20+
add_subdirectory(bluestore)
21+
target_link_libraries(os
22+
PRIVATE bluestore)
23+
endif()
6324

6425
if(WITH_FUSE)
65-
target_link_libraries(os FUSE::FUSE)
26+
add_library(fusestore
27+
FuseStore.cc)
28+
target_link_libraries(fusestore
29+
PRIVATE FUSE::FUSE)
30+
target_link_libraries(os
31+
PRIVATE fusestore)
6632
endif()
6733

6834
if(WITH_LTTNG)
6935
add_dependencies(os objectstore-tp)
70-
add_dependencies(os bluestore-tp)
7136
endif()
7237

7338
if(WITH_JAEGER)
7439
add_dependencies(os jaeger_base)
75-
target_link_libraries(os jaeger_base)
40+
target_link_libraries(os
41+
PRIVATE jaeger_base)
7642
endif()
7743

78-
target_link_libraries(os kv)
79-
80-
add_dependencies(os compressor_plugins)
81-
add_dependencies(os crypto_plugins)
82-
83-
8444
if(WITH_BLUESTORE)
8545
add_executable(ceph-bluestore-tool
8646
bluestore/bluestore_tool.cc)
8747
target_link_libraries(ceph-bluestore-tool
88-
os global)
48+
global kv os)
8949
install(TARGETS ceph-bluestore-tool
9050
DESTINATION bin)
9151
endif()

src/os/bluestore/CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
add_library(bluestore OBJECT
2+
Allocator.cc
3+
AllocatorBase.cc
4+
BitmapFreelistManager.cc
5+
BlueFS.cc
6+
bluefs_types.cc
7+
BlueRocksEnv.cc
8+
BlueStore.cc
9+
BlueStore_debug.cc
10+
simple_bitmap.cc
11+
bluestore_types.cc
12+
fastbmap_allocator_impl.cc
13+
FreelistManager.cc
14+
StupidAllocator.cc
15+
BitmapAllocator.cc
16+
AvlAllocator.cc
17+
BtreeAllocator.cc
18+
Btree2Allocator.cc
19+
HybridAllocator.cc
20+
Writer.cc
21+
Compression.cc
22+
BlueAdmin.cc
23+
BlueEnv.cc)
24+
25+
target_link_libraries(bluestore
26+
PRIVATE
27+
blk heap_profiler kv ${FMT_LIB})
28+
29+
add_dependencies(bluestore compressor_plugins)
30+
if(WITH_LTTNG)
31+
add_dependencies(bluestore bluestore-tp)
32+
endif()
33+
34+
if(WITH_BLUEFS)
35+
add_library(bluefs SHARED
36+
BlueRocksEnv.cc)
37+
target_include_directories(bluefs SYSTEM PUBLIC
38+
$<TARGET_PROPERTY:RocksDB::RocksDB,INTERFACE_INCLUDE_DIRECTORIES>)
39+
target_link_libraries(bluefs global)
40+
install(TARGETS bluefs DESTINATION lib)
41+
endif()

src/os/fs/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set(fs_srcs
2+
FS.cc)
3+
4+
if(HAVE_LIBXFS)
5+
list_(APPEND fs_srcs
6+
XFS.cc)
7+
endif()

src/os/kstore/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_library(kstore STATIC
2+
KStore.cc
3+
kstore_types.cc)
4+
target_compile_definitions(kstore
5+
PUBLIC WITH_KSTORE)
6+
target_link_libraries(kstore
7+
PUBLIC kv)

src/os/memstore/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include(CheckCXXCompilerFlag)
2+
3+
add_library(memstore
4+
MemStore.cc)
5+
check_cxx_compiler_flag("-Wno-maybe-uninitialized"
6+
HAS_WARNING_MAYBE_UNINITIALIZED)
7+
if(HAS_WARNING_MAYBE_UNINITIALIZED)
8+
target_compile_options(os
9+
PRIVATE "-Wno-maybe-uninitialized")
10+
endif()

src/test/objectstore/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ add_subdirectory(allocsim)
4545
add_executable(ceph_test_keyvaluedb
4646
test_kv.cc)
4747
target_link_libraries(ceph_test_keyvaluedb
48-
os
48+
kv
4949
ceph-common
5050
${UNITTEST_LIBS}
5151
global
@@ -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)