]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
CMake does support extra compression algorithms for Luminous. luminous
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 5 Dec 2018 08:21:06 +0000 (09:21 +0100)
committerKefu Chai <tchaikov@gmail.com>
Wed, 5 Dec 2018 15:50:57 +0000 (23:50 +0800)
Fixes: http://tracker.ceph.com/issues/22534
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
CMakeLists.txt
cmake/modules/Findzlib.cmake [new file with mode: 0644]
cmake/modules/Findzstd.cmake [new file with mode: 0644]

index 983f0be9f70c891b4a3224f43d12cf6310f1a96a..9363191ce5b6b7783d17d541267436cf55ace388 100644 (file)
@@ -56,6 +56,7 @@ else()
       include_directories(${JEMALLOC_INCLUDE_DIR})
     endif()
   endif()
+
   option(WITH_SNAPPY "build with SNAPPY" OFF)
   if(WITH_SNAPPY)
     find_package(snappy REQUIRED)
@@ -63,6 +64,30 @@ else()
     include_directories(${SNAPPY_INCLUDE_DIR})
     list(APPEND THIRDPARTY_LIBS ${SNAPPY_LIBRARIES})
   endif()
+
+  option(WITH_LZ4 "build with lz4" OFF)
+  if(WITH_LZ4)
+    find_package(lz4 REQUIRED)
+    add_definitions(-DLZ4)
+    include_directories(${LZ4_INCLUDE_DIR})
+    list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARIES})
+  endif()
+
+  option(WITH_ZLIB "build with zlib" OFF)
+  if(WITH_ZLIB)
+    find_package(zlib REQUIRED)
+    add_definitions(-DZLIB)
+    include_directories(${ZLIB_INCLUDE_DIR})
+    list(APPEND THIRDPARTY_LIBS ${ZLIB_LIBRARIES})
+  endif()
+
+  option(WITH_ZSTD "build with zstd" OFF)
+  if(WITH_ZSTD)
+    find_package(zstd REQUIRED)
+    add_definitions(-DZSTD)
+    include_directories(${ZSTD_INCLUDE_DIR})
+    list(APPEND THIRDPARTY_LIBS ${ZSTD_LIBRARIES})
+  endif()
 endif()
 
 if(WIN32)
diff --git a/cmake/modules/Findzlib.cmake b/cmake/modules/Findzlib.cmake
new file mode 100644 (file)
index 0000000..fb5aee9
--- /dev/null
@@ -0,0 +1,21 @@
+# - Find zlib
+# Find the zlib compression library and includes
+#
+# ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+
+find_path(ZLIB_INCLUDE_DIR
+  NAMES zlib.h
+  HINTS ${ZLIB_ROOT_DIR}/include)
+
+find_library(ZLIB_LIBRARIES
+  NAMES z
+  HINTS ${ZLIB_ROOT_DIR}/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(zlib DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIR)
+
+mark_as_advanced(
+  ZLIB_LIBRARIES
+  ZLIB_INCLUDE_DIR)
diff --git a/cmake/modules/Findzstd.cmake b/cmake/modules/Findzstd.cmake
new file mode 100644 (file)
index 0000000..a2964aa
--- /dev/null
@@ -0,0 +1,21 @@
+# - Find zstd
+# Find the zstd compression library and includes
+#
+# ZSTD_INCLUDE_DIR - where to find zstd.h, etc.
+# ZSTD_LIBRARIES - List of libraries when using zstd.
+# ZSTD_FOUND - True if zstd found.
+
+find_path(ZSTD_INCLUDE_DIR
+  NAMES zstd.h
+  HINTS ${ZSTD_ROOT_DIR}/include)
+
+find_library(ZSTD_LIBRARIES
+  NAMES zstd
+  HINTS ${ZSTD_ROOT_DIR}/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIR)
+
+mark_as_advanced(
+  ZSTD_LIBRARIES
+  ZSTD_INCLUDE_DIR)