Skip to content

Commit

Permalink
fix rocksdb compression detection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vuvova committed Apr 8, 2020
1 parent 5836191 commit d565895
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions storage/rocksdb/build_rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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'")
Expand All @@ -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)
Expand Down

0 comments on commit d565895

Please sign in to comment.