Skip to content

Commit c0c5785

Browse files
committed
Merge PR ceph#54042 into main
* refs/pull/54042/head: cmake: populate liburing include and library paths down to rocksdb external project cmake: promote uring package search to top-level Reviewed-by: Casey Bodley <[email protected]>
2 parents 2a9f369 + 8addb35 commit c0c5785

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ set(HAVE_LIBURING ${WITH_LIBURING})
256256
CMAKE_DEPENDENT_OPTION(WITH_SYSTEM_LIBURING "Require and build with system liburing" OFF
257257
"HAVE_LIBAIO;WITH_BLUESTORE" OFF)
258258

259+
if(WITH_LIBURING)
260+
if(WITH_SYSTEM_LIBURING)
261+
find_package(uring REQUIRED)
262+
else()
263+
include(Builduring)
264+
build_uring()
265+
endif()
266+
endif()
267+
259268
CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF
260269
"WITH_BLUESTORE" OFF)
261270
if(WITH_BLUESTORE_PMEM)

cmake/modules/BuildRocksDB.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ function(build_rocksdb)
1111
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
1212
endif()
1313

14+
list(APPEND rocksdb_CMAKE_ARGS -DWITH_LIBURING=${WITH_LIBURING})
15+
if(WITH_LIBURING)
16+
list(APPEND rocksdb_CMAKE_ARGS -During_INCLUDE_DIR=${URING_INCLUDE_DIR})
17+
list(APPEND rocksdb_CMAKE_ARGS -During_LIBRARIES=${URING_LIBRARY_DIR})
18+
list(APPEND rocksdb_INTERFACE_LINK_LIBRARIES uring::uring)
19+
endif()
20+
1421
if(ALLOCATOR STREQUAL "jemalloc")
1522
list(APPEND rocksdb_CMAKE_ARGS -DWITH_JEMALLOC=ON)
1623
list(APPEND rocksdb_INTERFACE_LINK_LIBRARIES JeMalloc::JeMalloc)

cmake/modules/Builduring.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ function(build_uring)
3232
ExternalProject_Get_Property(liburing_ext source_dir)
3333
set(URING_INCLUDE_DIR "${source_dir}/src/include")
3434
set(URING_LIBRARY_DIR "${source_dir}/src")
35+
set(URING_INCLUDE_DIR ${URING_INCLUDE_DIR} PARENT_SCOPE)
36+
set(URING_LIBRARY_DIR ${URING_LIBRARY_DIR} PARENT_SCOPE)
3537

3638
add_library(uring::uring STATIC IMPORTED GLOBAL)
3739
add_dependencies(uring::uring liburing_ext)

src/blk/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,5 @@ if(WITH_EVENTTRACE)
5757
endif()
5858

5959
if(WITH_LIBURING)
60-
if(WITH_SYSTEM_LIBURING)
61-
find_package(uring REQUIRED)
62-
else()
63-
include(Builduring)
64-
build_uring()
65-
endif()
6660
target_link_libraries(blk PRIVATE uring::uring)
6761
endif()

0 commit comments

Comments
 (0)