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

ASF GitHub Bot commented on PARQUET-1205:
-----------------------------------------

xhochy closed pull request #435: PARQUET-1205: Fix msvc build with static arrow 
lib
URL: https://github.com/apache/parquet-cpp/pull/435
 
 
   

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/CMakeLists.txt b/CMakeLists.txt
index 4ea7ae7b..f8fdf328 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -494,7 +494,7 @@ else()
     boost_static_regex)
   if(MSVC)
     set(BOOST_LINK_LIBS ${BOOST_LINK_LIBS}
-      boost_static_system)
+      boost_static_system boost_static_filesystem)
   endif()
 endif()
 
@@ -551,6 +551,8 @@ else()
     zstd
   )
 
+  add_definitions(-DARROW_EXPORTING)
+
   set(ARROW_LINK_LIBS
     arrow_static
     ${TRANSITIVE_LINK_LIBS})
diff --git a/cmake_modules/FindArrow.cmake b/cmake_modules/FindArrow.cmake
index 1ca27361..6af9f887 100644
--- a/cmake_modules/FindArrow.cmake
+++ b/cmake_modules/FindArrow.cmake
@@ -53,6 +53,10 @@ if ("${ARROW_HOME}" STREQUAL "")
 else()
   set(ARROW_HOME "${ARROW_HOME}")
 
+  if (MSVC AND NOT ARROW_MSVC_STATIC_LIB_SUFFIX)
+    set(ARROW_MSVC_STATIC_LIB_SUFFIX _static)
+  endif()
+
   set(ARROW_SEARCH_HEADER_PATHS
     ${ARROW_HOME}/include
     )
@@ -67,7 +71,7 @@ else()
     NO_DEFAULT_PATH
     )
 
-  find_library(ARROW_LIB_PATH NAMES arrow
+  find_library(ARROW_LIB_PATH NAMES arrow arrow${ARROW_MSVC_STATIC_LIB_SUFFIX}
     PATHS
     ${ARROW_SEARCH_LIB_PATH}
     NO_DEFAULT_PATH)
@@ -77,9 +81,6 @@ else()
     set(ARROW_HEADER_NAME arrow/api.h)
     set(ARROW_HEADER ${ARROW_INCLUDE_DIR}/${ARROW_HEADER_NAME})
     set(ARROW_LIB_NAME arrow)
-    if (MSVC AND NOT ARROW_MSVC_STATIC_LIB_SUFFIX)
-      set(ARROW_MSVC_STATIC_LIB_SUFFIX _static)
-    endif()
 
     get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY)
     set(ARROW_STATIC_LIB 
${ARROW_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ARROW_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
index 53a1dc74..b749ab63 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -91,7 +91,7 @@ else()
   # Find static Boost libraries.
   set(Boost_USE_STATIC_LIBS ON)
   if (MSVC)
-    find_package(Boost COMPONENTS regex system REQUIRED)
+    find_package(Boost COMPONENTS regex system filesystem REQUIRED)
   else()
     find_package(Boost COMPONENTS regex REQUIRED)
   endif()
@@ -99,11 +99,13 @@ else()
     set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG})
     if (MSVC)
       set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG})
+      set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG})
     endif()
   else()
     set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE})
     if (MSVC)
       set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
+      set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
     endif()
   endif()
 endif()
@@ -130,6 +132,8 @@ else()
   if (MSVC)
     add_library(boost_static_system STATIC IMPORTED)
     set_target_properties(boost_static_system PROPERTIES IMPORTED_LOCATION 
${BOOST_STATIC_SYSTEM_LIBRARY})
+    add_library(boost_static_filesystem STATIC IMPORTED)
+    set_target_properties(boost_static_filesystem PROPERTIES IMPORTED_LOCATION 
${BOOST_STATIC_FILESYSTEM_LIBRARY})
   endif()
 endif()
 


 

----------------------------------------------------------------
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:
[email protected]


> Fix msvc static build
> ---------------------
>
>                 Key: PARQUET-1205
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1205
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-cpp
>            Reporter: rip.nsk
>            Assignee: rip.nsk
>            Priority: Major
>
> Build is failed with the following options:
> -DPARQUET_BUILD_SHARED=OFF
>  -DPARQUET_BOOST_USE_SHARED=OFF
>  -DPARQUET_ARROW_LINKAGE=static
>  -DPARQUET_BUILD_EXECUTABLES=ON
>  -DPARQUET_BUILD_TESTS=ON



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

Reply via email to