Commit d565895b authored by Sergei Golubchik's avatar Sergei Golubchik

fix rocksdb compression detection

cmake module name is BZip2, not BZIP2.
variable names are WITH_ROCKSDB_zstd and WITH_ROCKSDB_snappy.
it's SNAPPY_FOUND in older cmake (and both in newer cmake).
also, make it verbose.
parent 5836191c
......@@ -35,8 +35,8 @@ endif()
# Optional compression libraries.
foreach(compression_lib LZ4 BZIP2 ZSTD snappy)
FIND_PACKAGE(${compression_lib} QUIET)
foreach(compression_lib LZ4 BZip2 ZSTD snappy)
FIND_PACKAGE(${compression_lib})
SET(WITH_ROCKSDB_${compression_lib} AUTO CACHE STRING
"Build RocksDB with ${compression_lib} compression. Possible values are 'ON', 'OFF', 'AUTO' and default is 'AUTO'")
......@@ -54,20 +54,20 @@ if(LZ4_FOUND AND (NOT WITH_ROCKSDB_LZ4 STREQUAL "OFF"))
list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARY})
endif()
if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZIP2 STREQUAL "OFF"))
if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZip2 STREQUAL "OFF"))
add_definitions(-DBZIP2)
include_directories(${BZIP2_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
endif()
if(snappy_FOUND AND (NOT WITH_ROCKSDB_SNAPPY STREQUAL "OFF"))
if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_snappy STREQUAL "OFF"))
add_definitions(-DSNAPPY)
include_directories(${snappy_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${snappy_LIBRARIES})
endif()
include(CheckFunctionExists)
if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_zstd STREQUAL "OFF"))
SET(CMAKE_REQUIRED_LIBRARIES zstd)
CHECK_FUNCTION_EXISTS(ZDICT_trainFromBuffer ZSTD_VALID)
UNSET(CMAKE_REQUIRED_LIBRARIES)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment