[ 
https://issues.apache.org/jira/browse/ARROW-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16351700#comment-16351700
 ] 

ASF GitHub Bot commented on ARROW-2084:
---------------------------------------

xhochy closed pull request #1554: ARROW-2084: [C++] Support newer Brotli static 
library names
URL: https://github.com/apache/arrow/pull/1554
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 0558cba49..38a4d772b 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 aa3d31f1f..dae5040c2 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 f2e714c6f..ea971f09e 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}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] Support newer Brotli static library names
> -----------------------------------------------
>
>                 Key: ARROW-2084
>                 URL: https://issues.apache.org/jira/browse/ARROW-2084
>             Project: Apache Arrow
>          Issue Type: Improvement
>            Reporter: Uwe L. Korn
>            Assignee: Phillip Cloud
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> They use {{-}} instead of {{_}} now.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to