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-1151: [C++] Link with static ms crt
Date Wed, 24 Jan 2018 22:23:17 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 01ab0cf  PARQUET-1151: [C++] Link with static ms crt
01ab0cf is described below

commit 01ab0cf9c859fa128cecc46e026a1d4324454b46
Author: Max Risuhin <risuhin.max@gmail.com>
AuthorDate: Wed Jan 24 23:23:07 2018 +0100

    PARQUET-1151: [C++] Link with static ms crt
    
    Author: Max Risuhin <risuhin.max@gmail.com>
    
    Closes #429 from MaxRis/PARQUET-1151 and squashes the following commits:
    
    ad22f6a [Max Risuhin] PARQUET-1151: [C++] Link with static ms crt
---
 CMakeLists.txt                          |  3 +++
 appveyor.yml                            | 10 ++++++++++
 ci/msvc-build.bat                       |  6 ++++++
 cmake_modules/ThirdpartyToolchain.cmake | 21 ++++++++++++++++++---
 4 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 278347d..4ea7ae7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,9 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
       "Arrow static lib suffix used on Windows with MSVC (default _static)")
     set(THRIFT_MSVC_STATIC_LIB_SUFFIX "md" CACHE STRING
       "Thrift static lib suffix used on Windows with MSVC (default md)")
+    option(PARQUET_USE_STATIC_CRT
+      "Build Parquet with statically linked CRT"
+      OFF)
   endif()
 endif()
 
diff --git a/appveyor.yml b/appveyor.yml
index ba78a02..7e39320 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -35,6 +35,16 @@ environment:
     - GENERATOR: Visual Studio 14 2015 Win64
       PYTHON: "3.5"
       ARCH: "64"
+      CONFIGURATION: "Debug"
+      USE_STATIC_CRT: "ON"
+    - GENERATOR: Visual Studio 14 2015 Win64
+      PYTHON: "3.5"
+      ARCH: "64"
+      CONFIGURATION: "Release"
+      USE_STATIC_CRT: "ON"
+    - GENERATOR: Visual Studio 14 2015 Win64
+      PYTHON: "3.5"
+      ARCH: "64"
       CONFIGURATION: "Toolchain"
   MSVC_DEFAULT_OPTIONS: ON
   BOOST_ROOT: C:\Libraries\boost_1_63_0
diff --git a/ci/msvc-build.bat b/ci/msvc-build.bat
index 29d8b83..56c7927 100644
--- a/ci/msvc-build.bat
+++ b/ci/msvc-build.bat
@@ -23,6 +23,11 @@ cd build
 SET PARQUET_TEST_DATA=%APPVEYOR_BUILD_FOLDER%\data
 set PARQUET_CXXFLAGS=/MP
 
+set PARQUET_USE_STATIC_CRT_OPTION=OFF
+if "%USE_STATIC_CRT%" == "ON" (
+      set PARQUET_USE_STATIC_CRT_OPTION=ON
+)
+
 if NOT "%CONFIGURATION%" == "Debug" (
   set PARQUET_CXXFLAGS="%PARQUET_CXXFLAGS% /WX"
 )
@@ -50,6 +55,7 @@ if NOT "%CONFIGURATION%" == "Toolchain" (
         -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
         -DPARQUET_BOOST_USE_SHARED=OFF ^
         -DPARQUET_CXXFLAGS=%PARQUET_CXXFLAGS% ^
+        -DPARQUET_USE_STATIC_CRT=%PARQUET_USE_STATIC_CRT_OPTION% ^
         .. || exit /B
 
   cmake --build . --config %CONFIGURATION% || exit /B
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index 52ab7a8..052bbfa 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -58,6 +58,9 @@ endif()
 # find boost headers and libs
 set(Boost_DEBUG TRUE)
 set(Boost_USE_MULTITHREADED ON)
+if (MSVC AND PARQUET_USE_STATIC_CRT)
+  set(Boost_USE_STATIC_RUNTIME ON)
+endif()
 if (PARQUET_BOOST_USE_SHARED)
   # Find shared Boost libraries.
   set(Boost_USE_STATIC_LIBS OFF)
@@ -188,8 +191,13 @@ if (NOT THRIFT_FOUND)
 
   set(THRIFT_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}thrift")
   if (MSVC)
-    set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}md")
-    set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=OFF")
+    if (PARQUET_USE_STATIC_CRT)
+      set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}mt")
+      set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=ON")
+    else()
+      set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}md")
+      set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=OFF")
+    endif()
   endif()
   if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
     set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}d")
@@ -258,8 +266,11 @@ if(PARQUET_BUILD_TESTS AND NOT IGNORE_OPTIONAL_PACKAGES)
 
     set(GTEST_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                          -DCMAKE_INSTALL_PREFIX=${GTEST_PREFIX}
-                         -Dgtest_force_shared_crt=ON
                          -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS})
+                
+    if (MSVC AND NOT PARQUET_USE_STATIC_CRT)
+      set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS} -Dgtest_force_shared_crt=ON)
+    endif()
 
     ExternalProject_Add(googletest_ep
       URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
@@ -365,6 +376,10 @@ if (NOT ARROW_FOUND)
     -DARROW_BOOST_USE_SHARED=${PARQUET_BOOST_USE_SHARED}
     -DARROW_BUILD_TESTS=OFF)
 
+  if (MSVC AND PARQUET_USE_STATIC_CRT)
+    set(ARROW_CMAKE_ARGS ${ARROW_CMAKE_ARGS} -DARROW_USE_STATIC_CRT=ON)
+  endif()
+
   if ("$ENV{PARQUET_ARROW_VERSION}" STREQUAL "")
     set(ARROW_VERSION "501d60e918bd4d10c429ab34e0b8e8a87dffb732")
   else()

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

Mime
View raw message