pineapple-src/externals/vcpkg/ports/arrow/fix-ThirdPartyToolchain.patch

144 lines
5.1 KiB
Diff
Raw Normal View History

2022-07-23 03:01:36 +02:00
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index f070323..290b5a7 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -53,7 +53,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
AWSSDK
benchmark
Boost
- Brotli
+ unofficial-brotli
BZip2
c-ares
gflags
@@ -62,7 +62,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
gRPC
GTest
LLVM
- Lz4
+ lz4
nlohmann_json
opentelemetry-cpp
ORC
@@ -72,7 +72,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
Snappy
Substrait
Thrift
- utf8proc
+ unofficial-utf8proc
xsimd
ZLIB
zstd)
@@ -139,6 +139,9 @@ foreach(DEPENDENCY ${ARROW_THIRDPARTY_DEPENDENCIES})
endforeach()
macro(build_dependency DEPENDENCY_NAME)
+ if(NOT "${DEPENDENCY_NAME}" STREQUAL "xsimd")
+ message(FATAL_ERROR "dependencies should never be built in vcpkg")
+ endif()
if("${DEPENDENCY_NAME}" STREQUAL "AWSSDK")
build_awssdk()
elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark")
@@ -222,7 +225,7 @@ macro(resolve_dependency DEPENDENCY_NAME)
endif()
if(ARG_HAVE_ALT)
- set(PACKAGE_NAME "${DEPENDENCY_NAME}Alt")
+ set(PACKAGE_NAME "${DEPENDENCY_NAME}")
else()
set(PACKAGE_NAME ${DEPENDENCY_NAME})
endif()
@@ -1129,10 +1132,16 @@ macro(build_brotli)
endmacro()
if(ARROW_WITH_BROTLI)
- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
+ resolve_dependency(unofficial-brotli USE_CONFIG TRUE PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
+ add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon)
+ add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc)
+ add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec)
+ get_target_property(BROTLI_INCLUDE_DIR unofficial::brotli::brotlicommon-static INTERFACE_INCLUDE_DIRECTORIES)
# TODO: Don't use global includes but rather target_include_directories
+ if(NOT BROTLI_INCLUDE_DIR)
get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon
INTERFACE_INCLUDE_DIRECTORIES)
+ endif()
include_directories(SYSTEM ${BROTLI_INCLUDE_DIR})
endif()
@@ -1249,7 +1261,7 @@ macro(build_glog)
endmacro()
if(ARROW_USE_GLOG)
- resolve_dependency(GLOG PC_PACKAGE_NAMES libglog)
+ resolve_dependency(glog USE_CONFIG TRUE PC_PACKAGE_NAMES libglog)
# TODO: Don't use global includes but rather target_include_directories
get_target_property(GLOG_INCLUDE_DIR glog::glog INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${GLOG_INCLUDE_DIR})
@@ -1434,6 +1446,13 @@ if(ARROW_WITH_THRIFT)
# TODO: Don't use global includes but rather target_include_directories
include_directories(SYSTEM ${THRIFT_INCLUDE_DIR})
+ if(THRIFT_INCLUDE_DIR)
+ file(READ "${THRIFT_INCLUDE_DIR}/config.h" THRIFT_CONFIG_H_CONTENT)
+ string(REGEX MATCH "#define PACKAGE_VERSION \"[0-9.]+\"" THRIFT_VERSION_DEFINITION "${THRIFT_CONFIG_H_CONTENT}")
+ string(REGEX MATCH "[0-9.]+" THRIFT_VERSION "${THRIFT_VERSION_DEFINITION}")
+ set(THRIFT_VERSION "${THRIFT_VERSION}")
+ endif()
+
string(REPLACE "." ";" VERSION_LIST ${THRIFT_VERSION})
list(GET VERSION_LIST 0 THRIFT_VERSION_MAJOR)
list(GET VERSION_LIST 1 THRIFT_VERSION_MINOR)
@@ -1561,6 +1580,8 @@ if(ARROW_WITH_PROTOBUF)
${ARROW_PROTOBUF_REQUIRED_VERSION}
PC_PACKAGE_NAMES
protobuf)
+ get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf
+ INTERFACE_INCLUDE_DIRECTORIES)
if(NOT Protobuf_USE_STATIC_LIBS AND MSVC_TOOLCHAIN)
add_definitions(-DPROTOBUF_USE_DLLS)
@@ -2121,8 +2142,6 @@ endmacro()
if(ARROW_WITH_RAPIDJSON)
set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0")
resolve_dependency(RapidJSON
- HAVE_ALT
- TRUE
REQUIRED_VERSION
${ARROW_RAPIDJSON_REQUIRED_VERSION}
IS_RUNTIME_DEPENDENCY
@@ -2260,7 +2279,8 @@ macro(build_lz4)
endmacro()
if(ARROW_WITH_LZ4)
- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4)
+ resolve_dependency(lz4 USE_CONFIG TRUE PC_PACKAGE_NAMES liblz4)
+ add_library(LZ4::lz4 ALIAS lz4::lz4)
# TODO: Don't use global includes but rather target_include_directories
get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES)
@@ -2517,11 +2537,10 @@ macro(build_utf8proc)
endmacro()
if(ARROW_WITH_UTF8PROC)
- resolve_dependency(utf8proc
- REQUIRED_VERSION
- "2.2.0"
+ resolve_dependency(unofficial-utf8proc
PC_PACKAGE_NAMES
libutf8proc)
+ add_library(utf8proc::utf8proc ALIAS utf8proc)
add_definitions(-DARROW_WITH_UTF8PROC)
@@ -3719,6 +3738,9 @@ if(ARROW_WITH_GRPC)
# TODO: Don't use global includes but rather target_include_directories
get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++ INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${GRPC_INCLUDE_DIR})
+ if (ABSL_USE_CXX17)
+ set(CMAKE_CXX_STANDARD 17)
+ endif()
if(GRPC_VENDORED)
set(GRPCPP_PP_INCLUDE TRUE)