[arrow]Fix build error on Visual Studio 2019. (#8263)

This commit is contained in:
JackBoosY 2019-09-26 17:49:59 +08:00 committed by Griffin Downs
parent 273c31fe37
commit c7b705fc05
3 changed files with 33 additions and 1 deletions

View File

@ -1,5 +1,5 @@
Source: arrow
Version: 0.14.1
Version: 0.14.1-1
Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser
Homepage: https://github.com/apache/arrow
Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations.

View File

@ -0,0 +1,31 @@
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index 496904b..887f9c4 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -124,7 +124,9 @@ macro(arrow_add_werror_if_debug)
if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
# Treat all compiler warnings as errors
if("${COMPILER_FAMILY}" STREQUAL "msvc")
- set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX")
+ if (MSVC_VERSION VERSION_LESS 1900)
+ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX")
+ endif()
else()
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror")
endif()
diff --git a/cpp/src/parquet/schema.h b/cpp/src/parquet/schema.h
index 740edbc..1526c73 100644
--- a/cpp/src/parquet/schema.h
+++ b/cpp/src/parquet/schema.h
@@ -457,7 +457,11 @@ class PARQUET_EXPORT SchemaDescriptor {
// -- -- b |
// -- -- -- c |
// -- -- -- -- d
+#if _MSC_VER >= 1900
+ std::unordered_map<int, schema::NodePtr> leaf_to_base_;
+#else
std::unordered_map<int, const schema::NodePtr> leaf_to_base_;
+#endif
// Mapping between ColumnPath DotString to the leaf index
std::unordered_multimap<std::string, int> leaf_to_idx_;

View File

@ -12,6 +12,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
all.patch
fix-msvc-1900.patch
)
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_BUILD_SHARED)