parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [parquet-cpp] branch master updated: PARQUET-1205: Fix msvc build with static arrow lib
Date Sat, 10 Feb 2018 18:39:44 GMT
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/parquet-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new f13c61f  PARQUET-1205: Fix msvc build with static arrow lib
f13c61f is described below

commit f13c61fd4447bee82ffc5807a03b8ba01960430a
Author: revaliu <revaliu@microsoft.com>
AuthorDate: Sat Feb 10 19:39:34 2018 +0100

    PARQUET-1205: Fix msvc build with static arrow lib
    
    Author: revaliu <revaliu@microsoft.com>
    
    Closes #435 from rip-nsk/PARQUET-1205 and squashes the following commits:
    
    60eacb2 [revaliu] allow to use static only arrow library
    511b369 [revaliu] boost_static_filesystem is required for static build
---
 CMakeLists.txt                          | 4 +++-
 cmake_modules/FindArrow.cmake           | 9 +++++----
 cmake_modules/ThirdpartyToolchain.cmake | 6 +++++-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ea7ae7..f8fdf32 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 1ca2736..6af9f88 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 53a1dc7..b749ab6 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()
 

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

Mime
View raw message