From c7b705fc057ccf6571110378b05d0230d6e6f2a6 Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Thu, 26 Sep 2019 17:49:59 +0800 Subject: [PATCH] [arrow]Fix build error on Visual Studio 2019. (#8263) --- ports/arrow/CONTROL | 2 +- ports/arrow/fix-msvc-1900.patch | 31 +++++++++++++++++++++++++++++++ ports/arrow/portfile.cmake | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ports/arrow/fix-msvc-1900.patch diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index ea787e24a..9650c7823 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -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. diff --git a/ports/arrow/fix-msvc-1900.patch b/ports/arrow/fix-msvc-1900.patch new file mode 100644 index 000000000..7c29070b7 --- /dev/null +++ b/ports/arrow/fix-msvc-1900.patch @@ -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 leaf_to_base_; ++#else + std::unordered_map leaf_to_base_; ++#endif + + // Mapping between ColumnPath DotString to the leaf index + std::unordered_multimap leaf_to_idx_; diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index 58b6f489c..3b8fc16d6 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -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)