vcpkg/ports/rocksdb/0001-fix-dependencies.patch

111 lines
2.9 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b684311d..a71c14ed5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,7 +111,7 @@ endif()
include(CMakeDependentOption)
-if(MSVC)
+if(0)
option(WITH_GFLAGS "build with GFlags" OFF)
option(WITH_XPRESS "build with windows built in compression" OFF)
option(ROCKSDB_SKIP_THIRDPARTY "skip thirdparty.inc" OFF)
@@ -165,10 +165,7 @@ else()
endif()
if(WITH_SNAPPY)
- find_package(Snappy CONFIG)
- if(NOT Snappy_FOUND)
- find_package(Snappy REQUIRED)
- endif()
+ find_package(Snappy CONFIG REQUIRED)
add_definitions(-DSNAPPY)
list(APPEND THIRDPARTY_LIBS Snappy::snappy)
endif()
@@ -192,16 +189,15 @@ else()
endif()
if(WITH_LZ4)
- find_package(lz4 REQUIRED)
+ find_package(lz4 CONFIG REQUIRED)
add_definitions(-DLZ4)
list(APPEND THIRDPARTY_LIBS lz4::lz4)
endif()
if(WITH_ZSTD)
- find_package(zstd REQUIRED)
+ find_package(zstd CONFIG REQUIRED)
add_definitions(-DZSTD)
- include_directories(${ZSTD_INCLUDE_DIRS})
- list(APPEND THIRDPARTY_LIBS zstd::zstd)
+ list(APPEND THIRDPARTY_LIBS zstd::libzstd)
endif()
endif()
@@ -352,11 +348,10 @@ int main() {
endif()
if (WITH_LIBURING)
- find_package(uring)
- if (uring_FOUND)
- add_definitions(-DROCKSDB_IOURING_PRESENT)
- list(APPEND THIRDPARTY_LIBS uring::uring)
- endif()
+ find_package(PkgConfig)
+ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
+ add_definitions(-DROCKSDB_IOURING_PRESENT)
+ list(APPEND THIRDPARTY_LIBS PkgConfig::liburing)
endif()
# Reset the required flags
@@ -414,10 +409,9 @@ endif()
option(WITH_NUMA "build with NUMA policy support" OFF)
if(WITH_NUMA)
- find_package(NUMA REQUIRED)
+ find_package(unofficial-numa CONFIG REQUIRED)
add_definitions(-DNUMA)
- include_directories(${NUMA_INCLUDE_DIRS})
- list(APPEND THIRDPARTY_LIBS NUMA::NUMA)
+ list(APPEND THIRDPARTY_LIBS unofficial::numa::numa)
endif()
# Stall notifications eat some performance from inserts
@@ -1393,7 +1387,6 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS)
endforeach()
endforeach()
- install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination})
install(
TARGETS ${ROCKSDB_STATIC_LIB}
diff --git a/cmake/RocksDBConfig.cmake.in b/cmake/RocksDBConfig.cmake.in
index bab7e8ea6..4c28d5303 100644
--- a/cmake/RocksDBConfig.cmake.in
+++ b/cmake/RocksDBConfig.cmake.in
@@ -33,15 +33,20 @@ if(@WITH_BZ2@)
endif()
if(@WITH_LZ4@)
- find_dependency(lz4)
+ find_dependency(lz4 CONFIG)
endif()
if(@WITH_ZSTD@)
- find_dependency(zstd)
+ find_dependency(zstd CONFIG)
endif()
if(@WITH_NUMA@)
- find_dependency(NUMA)
+ find_dependency(unofficial-numa CONFIG)
+endif()
+
+if(@WITH_LIBURING@)
+ find_dependency(PkgConfig)
+ pkg_check_modules(liburing REQUIRED IMPORTED_TARGET GLOBAL liburing>=2.0)
endif()
find_dependency(Threads)