[
https://issues.apache.org/jira/browse/PARQUET-1151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16338333#comment-16338333
]
ASF GitHub Bot commented on PARQUET-1151:
-----------------------------------------
xhochy closed pull request #429: PARQUET-1151: [C++] Link with static ms crt
URL: https://github.com/apache/parquet-cpp/pull/429
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 278347d2..4ea7ae7b 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 ba78a022..7e393205 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -32,6 +32,16 @@ environment:
PYTHON: "3.5"
ARCH: "64"
CONFIGURATION: "Release"
+ - 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"
diff --git a/ci/msvc-build.bat b/ci/msvc-build.bat
index 29d8b839..56c79274 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 52ab7a8d..052bbfae 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()
----------------------------------------------------------------
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]
> [C++] Add build options / configuration to use static runtime libraries with
> MSVC
> ---------------------------------------------------------------------------------
>
> Key: PARQUET-1151
> URL: https://issues.apache.org/jira/browse/PARQUET-1151
> Project: Parquet
> Issue Type: Improvement
> Components: parquet-cpp
> Reporter: Wes McKinney
> Assignee: Max Risuhin
> Priority: Major
> Fix For: cpp-1.4.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)