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

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


The following commit(s) were added to refs/heads/master by this push:
     new d949ee6  ARROW-2084: [C++] Support newer Brotli static library names
d949ee6 is described below

commit d949ee6cce7de52f0f87dc1a78e45accc4139c46
Author: Uwe L. Korn <uw...@xhochy.com>
AuthorDate: Sun Feb 4 10:13:46 2018 +0100

    ARROW-2084: [C++] Support newer Brotli static library names
    
    Author: Uwe L. Korn <uw...@xhochy.com>
    
    Closes #1554 from cpcloud/ARROW-2084 and squashes the following commits:
    
    3361f13 [Uwe L. Korn] ARROW-2084: [C++] Support newer Brotli static library 
names
---
 cpp/CMakeLists.txt                 |  4 ++--
 cpp/apidoc/Windows.md              |  6 ++++--
 cpp/cmake_modules/FindBrotli.cmake | 33 ++++++++++++++++++++++-----------
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 0558cba..38a4d77 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -204,8 +204,8 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL 
"${CMAKE_CURRENT_SOURCE_DIR}")
     ON)
 
   if (MSVC)
-    set(BROTLI_MSVC_STATIC_LIB_SUFFIX "_static" CACHE STRING
-      "Brotli static lib suffix used on Windows with MSVC (default _static)")
+    set(BROTLI_MSVC_STATIC_LIB_SUFFIX "-static" CACHE STRING
+      "Brotli static lib suffix used on Windows with MSVC (default -static)")
     set(SNAPPY_MSVC_STATIC_LIB_SUFFIX "_static" CACHE STRING
       "Snappy static lib suffix used on Windows with MSVC (default is empty 
string)")
     set(ZLIB_MSVC_STATIC_LIB_SUFFIX "libstatic" CACHE STRING
diff --git a/cpp/apidoc/Windows.md b/cpp/apidoc/Windows.md
index aa3d31f..dae5040 100644
--- a/cpp/apidoc/Windows.md
+++ b/cpp/apidoc/Windows.md
@@ -95,9 +95,11 @@ party static libs.
 build. Set `ZLIB_HOME` environment variable. Pass
 `-DZLIB_MSVC_STATIC_LIB_SUFFIX=%ZLIB_SUFFIX%` to link with z%ZLIB_SUFFIX%.lib
 
-`brotli`. Set `BROTLY_HOME` environment variable. Pass
+`brotli`. Set `BROTLI_HOME` environment variable. Pass
 `-DBROTLI_MSVC_STATIC_LIB_SUFFIX=%BROTLI_SUFFIX%` to link with
-brotli*%BROTLI_SUFFIX%.lib.
+brotli*%BROTLI_SUFFIX%.lib. For brotli versions <= 0.6.0 installed from
+conda-forge this must be set to `_static`, otherwise the default of `-static`
+is used.
 
 `snappy`. Set `SNAPPY_HOME` environment variable. Pass
 `-DSNAPPY_MSVC_STATIC_LIB_SUFFIX=%SNAPPY_SUFFIX%` to link with
diff --git a/cpp/cmake_modules/FindBrotli.cmake 
b/cpp/cmake_modules/FindBrotli.cmake
index f2e714c..ea971f0 100644
--- a/cpp/cmake_modules/FindBrotli.cmake
+++ b/cpp/cmake_modules/FindBrotli.cmake
@@ -43,17 +43,17 @@ find_path( BROTLI_INCLUDE_DIR NAMES brotli/decode.h
   NO_DEFAULT_PATH
   PATH_SUFFIXES "include" )
 
-find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc.a brotlienc
+find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc.a libbrotlienc-static.a 
brotlienc
   PATHS ${_brotli_roots}
   NO_DEFAULT_PATH
   PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" )
 
-find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec.a brotlidec
+find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec.a libbrotlidec-static.a 
brotlidec
   PATHS ${_brotli_roots}
   NO_DEFAULT_PATH
   PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" )
 
-find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon.a brotlicommon
+find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon.a 
libbrotlicommon-static.a brotlicommon
   PATHS ${_brotli_roots}
   NO_DEFAULT_PATH
   PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" )
@@ -65,16 +65,27 @@ if (BROTLI_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR 
BROTLI_LIBRARIES))
   set(BROTLI_FOUND TRUE)
   get_filename_component( BROTLI_LIBS ${BROTLI_LIBRARY_ENC} PATH )
   set(BROTLI_LIB_NAME brotli)
-  if (MSVC AND NOT BROTLI_MSVC_STATIC_LIB_SUFFIX)
-    set(BROTLI_MSVC_STATIC_LIB_SUFFIX _static)
+  if (BROTLI_MSVC_STATIC_LIB_SUFFIX)
+    set(BROTLI_STATIC_LIB_SUFFIX "${BROTLI_MSVC_STATIC_LIB_SUFFIX}")
+  endif()
+  if (NOT BROTLI_STATIC_LIB_SUFFIX)
+    if (EXISTS 
"${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc-static${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(BROTLI_STATIC_LIB_SUFFIX -static)
+    else()
+      if (MSVC)
+        set(BROTLI_STATIC_LIB_SUFFIX _static)
+      else()
+        set(BROTLI_STATIC_LIB_SUFFIX "")
+      endif()
+    endif()
   endif()
   set(BROTLI_STATIC_LIB
-      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
-      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
-      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
-  set(BROTLI_STATIC_LIBRARY_ENC 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
-  set(BROTLI_STATIC_LIBRARY_DEC 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
-  set(BROTLI_STATIC_LIBRARY_COMMON 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
+      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
+      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
+      
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(BROTLI_STATIC_LIBRARY_ENC 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(BROTLI_STATIC_LIBRARY_DEC 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(BROTLI_STATIC_LIBRARY_COMMON 
${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
   set(BROTLI_SHARED_LIB
       
${BROTLI_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${CMAKE_SHARED_LIBRARY_SUFFIX}
       
${BROTLI_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${CMAKE_SHARED_LIBRARY_SUFFIX}

-- 
To stop receiving notification emails like this one, please contact
u...@apache.org.

Reply via email to