This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/master by this push:
     new f168078  Orc 446: [C++] Add possibility to use prebuilt (windows) zstd 
lib
f168078 is described below

commit f16807863ca99280166a4d7a700af977ec87f1e2
Author: Renat Valiullin <[email protected]>
AuthorDate: Wed Dec 5 16:00:51 2018 -0800

    Orc 446: [C++] Add possibility to use prebuilt (windows) zstd lib
    
    Fixes #347
    
    Signed-off-by: Gang Wu <[email protected]>
---
 c++/src/Compression.cc       | 4 ++++
 cmake_modules/FindZSTD.cmake | 9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/c++/src/Compression.cc b/c++/src/Compression.cc
index d1f7c4f..44bd22d 100644
--- a/c++/src/Compression.cc
+++ b/c++/src/Compression.cc
@@ -32,6 +32,10 @@
 
 #include "wrap/snappy-wrapper.h"
 
+#ifndef ZSTD_CLEVEL_DEFAULT
+#define ZSTD_CLEVEL_DEFAULT 3
+#endif
+
 namespace orc {
 
   class CompressionStreamBase: public BufferedOutputStream {
diff --git a/cmake_modules/FindZSTD.cmake b/cmake_modules/FindZSTD.cmake
index 3dba072..e088976 100644
--- a/cmake_modules/FindZSTD.cmake
+++ b/cmake_modules/FindZSTD.cmake
@@ -23,12 +23,16 @@ endif()
 
 message (STATUS "ZSTD_HOME: ${ZSTD_HOME}")
 
+if (NOT ZSTD_STATIC_LIB_NAME)
+  set (ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd)
+endif()
+
 find_path (ZSTD_INCLUDE_DIR zstd.h HINTS
         ${_zstd_path}
         NO_DEFAULT_PATH
         PATH_SUFFIXES "include")
 
-find_library (ZSTD_LIBRARIES NAMES zstd HINTS
+find_library (ZSTD_LIBRARIES NAMES ${ZSTD_STATIC_LIB_NAME} HINTS
         ${_zstd_path}
         PATH_SUFFIXES "lib")
 
@@ -37,8 +41,7 @@ if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARIES)
   get_filename_component (ZSTD_LIBS ${ZSTD_LIBRARIES} PATH)
   set (ZSTD_HEADER_NAME zstd.h)
   set (ZSTD_HEADER ${ZSTD_INCLUDE_DIR}/${ZSTD_HEADER_NAME})
-  set (ZSTD_LIB_NAME zstd)
-  set (ZSTD_STATIC_LIB 
${ZSTD_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ZSTD_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set (ZSTD_STATIC_LIB 
${ZSTD_LIBS}/${ZSTD_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
 else ()
   set (ZSTD_FOUND FALSE)
 endif ()

Reply via email to