mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 03:10:57 +08:00
[folly][rocksdb] Fix lz4+snappy support
This commit is contained in:
parent
cf9987e21a
commit
eea766d2d0
@ -1,5 +1,5 @@
|
||||
Source: folly
|
||||
Version: 2018.03.19.00-1
|
||||
Version: 2018.03.19.00-2
|
||||
Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows
|
||||
Build-Depends: openssl, libevent, double-conversion, glog, gflags, boost-chrono, boost-context, boost-conversion, boost-crc, boost-date-time, boost-filesystem, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-thread
|
||||
Default-Features: zlib
|
||||
|
@ -1,9 +1,10 @@
|
||||
find_path(LZ4_INCLUDE_DIR lz4.h)
|
||||
|
||||
find_package(LZ4_LIBRARY_DEBUG NAMES lz4d)
|
||||
find_package(LZ4_LIBRARY_RELEASE NAMES lz4)
|
||||
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
|
||||
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
|
||||
|
||||
select_library_configurations(LZ4_LIBRARY)
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(LZ4)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
|
@ -1,9 +1,10 @@
|
||||
find_path(SNAPPY_INCLUDE_DIR snappy.h)
|
||||
|
||||
find_package(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
|
||||
find_package(SNAPPY_LIBRARY_RELEASE NAMES snappy)
|
||||
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
|
||||
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
|
||||
|
||||
select_library_configurations(SNAPPY_LIBRARY)
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(SNAPPY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
|
@ -1,4 +1,12 @@
|
||||
Source: rocksdb
|
||||
Version: 5.11.3
|
||||
Version: 5.11.3-1
|
||||
Description: A library that provides an embeddable, persistent key-value store for fast storage
|
||||
Build-Depends: zlib
|
||||
|
||||
Feature: lz4
|
||||
Build-Depends: lz4
|
||||
Description: lz4 support in rocksdb
|
||||
|
||||
Feature: snappy
|
||||
Build-Depends: snappy
|
||||
Description: snappy support in rocksdb
|
||||
|
13
ports/rocksdb/Findlz4.cmake
Normal file
13
ports/rocksdb/Findlz4.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
find_path(LZ4_INCLUDE_DIR lz4.h)
|
||||
|
||||
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
|
||||
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(LZ4)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
LZ4 DEFAULT_MSG
|
||||
LZ4_LIBRARY LZ4_INCLUDE_DIR
|
||||
)
|
13
ports/rocksdb/Findsnappy.cmake
Normal file
13
ports/rocksdb/Findsnappy.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
find_path(SNAPPY_INCLUDE_DIR snappy.h)
|
||||
|
||||
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
|
||||
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(SNAPPY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
SNAPPY DEFAULT_MSG
|
||||
SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR
|
||||
)
|
@ -9,14 +9,19 @@ vcpkg_from_github(
|
||||
)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/0002-disable-gtest.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/0003-only-build-one-flavor.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/use-find-package.patch"
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/cmake/modules/Findzlib.cmake")
|
||||
file(COPY
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Findlz4.cmake"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Findsnappy.cmake"
|
||||
DESTINATION "${SOURCE_PATH}/cmake/modules"
|
||||
)
|
||||
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
set(WITH_MD_LIBRARY OFF)
|
||||
@ -27,13 +32,26 @@ endif()
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ROCKSDB_DISABLE_INSTALL_SHARED_LIB)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ROCKSDB_DISABLE_INSTALL_STATIC_LIB)
|
||||
|
||||
set(WITH_LZ4 OFF)
|
||||
if("lz4" IN_LIST FEATURES)
|
||||
set(WITH_LZ4 ON)
|
||||
endif()
|
||||
|
||||
set(WITH_SNAPPY OFF)
|
||||
if("snappy" IN_LIST FEATURES)
|
||||
set(WITH_SNAPPY ON)
|
||||
endif()
|
||||
|
||||
get_filename_component(ROCKSDB_VERSION "${SOURCE_PATH}" NAME)
|
||||
string(REPLACE "rocksdb-rocksdb-" "" ROCKSDB_VERSION "${ROCKSDB_VERSION}")
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DWITH_GFLAGS=0
|
||||
-DWITH_SNAPPY=0
|
||||
-DWITH_LZ4=0
|
||||
-DWITH_SNAPPY=${WITH_SNAPPY}
|
||||
-DWITH_LZ4=${WITH_LZ4}
|
||||
-DWITH_ZLIB=1
|
||||
-DWITH_TESTS=OFF
|
||||
-DROCKSDB_INSTALL_ON_WINDOWS=ON
|
||||
@ -43,7 +61,7 @@ vcpkg_configure_cmake(
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
-DROCKSDB_DISABLE_INSTALL_SHARED_LIB=${ROCKSDB_DISABLE_INSTALL_SHARED_LIB}
|
||||
-DROCKSDB_DISABLE_INSTALL_STATIC_LIB=${ROCKSDB_DISABLE_INSTALL_STATIC_LIB}
|
||||
-DROCKSDB_VERSION=5.11.3
|
||||
-DROCKSDB_VERSION=${ROCKSDB_VERSION}
|
||||
-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_TBB=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_NUMA=TRUE
|
||||
|
Loading…
x
Reference in New Issue
Block a user