2021-07-23 04:45:35 +08:00
|
|
|
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
|
2021-12-09 06:05:15 +08:00
|
|
|
index ba8c36e81..eac441dee 100644
|
2021-07-23 04:45:35 +08:00
|
|
|
--- a/cpp/CMakeLists.txt
|
|
|
|
+++ b/cpp/CMakeLists.txt
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -689,7 +689,7 @@ endif()
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
if(ARROW_WITH_BROTLI)
|
|
|
|
# Order is important for static linking
|
|
|
|
- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon)
|
|
|
|
+ set(ARROW_BROTLI_LIBS unofficial::brotli::brotlienc unofficial::brotli::brotlidec unofficial::brotli::brotlicommon)
|
|
|
|
list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS})
|
|
|
|
list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS})
|
|
|
|
if(Brotli_SOURCE STREQUAL "SYSTEM")
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -705,9 +705,9 @@ if(ARROW_WITH_BZ2)
|
2021-07-23 04:45:35 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ARROW_WITH_LZ4)
|
|
|
|
- list(APPEND ARROW_STATIC_LINK_LIBS LZ4::lz4)
|
|
|
|
+ list(APPEND ARROW_STATIC_LINK_LIBS lz4::lz4)
|
|
|
|
if(Lz4_SOURCE STREQUAL "SYSTEM")
|
|
|
|
- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4)
|
|
|
|
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS lz4::lz4)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -764,10 +764,10 @@ if(ARROW_S3)
|
2021-07-23 04:45:35 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ARROW_WITH_UTF8PROC)
|
|
|
|
- list(APPEND ARROW_LINK_LIBS utf8proc::utf8proc)
|
|
|
|
- list(APPEND ARROW_STATIC_LINK_LIBS utf8proc::utf8proc)
|
|
|
|
+ list(APPEND ARROW_LINK_LIBS utf8proc)
|
|
|
|
+ list(APPEND ARROW_STATIC_LINK_LIBS utf8proc)
|
|
|
|
if(utf8proc_SOURCE STREQUAL "SYSTEM")
|
|
|
|
- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc::utf8proc)
|
|
|
|
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
|
2021-12-09 06:05:15 +08:00
|
|
|
index 673a58eed..8c2c1e2fb 100644
|
2021-07-23 04:45:35 +08:00
|
|
|
--- 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
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -62,14 +62,14 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
|
2021-07-23 04:45:35 +08:00
|
|
|
gRPC
|
|
|
|
GTest
|
|
|
|
LLVM
|
|
|
|
- Lz4
|
|
|
|
+ lz4
|
|
|
|
ORC
|
|
|
|
re2
|
|
|
|
Protobuf
|
|
|
|
RapidJSON
|
|
|
|
Snappy
|
|
|
|
Thrift
|
|
|
|
- utf8proc
|
|
|
|
+ unofficial-utf8proc
|
|
|
|
xsimd
|
|
|
|
ZLIB
|
|
|
|
zstd)
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -872,17 +872,7 @@ set(Boost_ADDITIONAL_VERSIONS
|
|
|
|
# so we first need to determine whether we're building it
|
|
|
|
if(ARROW_WITH_THRIFT AND Thrift_SOURCE STREQUAL "AUTO")
|
|
|
|
find_package(Thrift 0.11.0 MODULE COMPONENTS ${ARROW_THRIFT_REQUIRED_COMPONENTS})
|
|
|
|
- if(Thrift_FOUND)
|
|
|
|
- find_package(PkgConfig QUIET)
|
|
|
|
- pkg_check_modules(THRIFT_PC
|
|
|
|
- thrift
|
|
|
|
- NO_CMAKE_PATH
|
|
|
|
- NO_CMAKE_ENVIRONMENT_PATH
|
|
|
|
- QUIET)
|
|
|
|
- if(THRIFT_PC_FOUND)
|
|
|
|
- string(APPEND ARROW_PC_REQUIRES_PRIVATE " thrift")
|
|
|
|
- endif()
|
|
|
|
- else()
|
|
|
|
+ if(NOT Thrift_FOUND AND NOT THRIFT_FOUND)
|
|
|
|
set(Thrift_SOURCE "BUNDLED")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
@@ -991,7 +981,7 @@ macro(build_snappy)
|
2021-07-23 04:45:35 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(ARROW_WITH_SNAPPY)
|
2021-08-05 18:01:46 +08:00
|
|
|
- resolve_dependency(Snappy PC_PACKAGE_NAMES snappy)
|
|
|
|
+ resolve_dependency(Snappy USE_CONFIG TRUE PC_PACKAGE_NAMES snappy)
|
|
|
|
if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND)
|
|
|
|
get_target_property(SNAPPY_LIB Snappy::snappy IMPORTED_LOCATION)
|
|
|
|
string(APPEND ARROW_PC_LIBS_PRIVATE " ${SNAPPY_LIB}")
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1061,10 +1051,16 @@ macro(build_brotli)
|
2021-07-23 04:45:35 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(ARROW_WITH_BROTLI)
|
2021-08-05 18:01:46 +08:00
|
|
|
- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
|
2021-07-23 04:45:35 +08:00
|
|
|
+ set(unofficial-brotli_SOURCE "SYSTEM")
|
2021-08-05 18:01:46 +08:00
|
|
|
+ resolve_dependency(unofficial-brotli USE_CONFIG TRUE PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
|
2021-07-23 04:45:35 +08:00
|
|
|
# TODO: Don't use global includes but rather target_include_directories
|
|
|
|
- get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon
|
|
|
|
- INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ if (BUILD_SHARED_LIBS)
|
|
|
|
+ get_target_property(BROTLI_INCLUDE_DIR unofficial::brotli::brotlicommon
|
|
|
|
+ INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ else()
|
|
|
|
+ get_target_property(BROTLI_INCLUDE_DIR unofficial::brotli::brotlicommon-static
|
|
|
|
+ INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ endif()
|
|
|
|
include_directories(SYSTEM ${BROTLI_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1181,7 +1177,7 @@ macro(build_glog)
|
2021-07-23 04:45:35 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(ARROW_USE_GLOG)
|
2021-08-05 18:01:46 +08:00
|
|
|
- resolve_dependency(GLOG PC_PACKAGE_NAMES libglog)
|
|
|
|
+ resolve_dependency(glog USE_CONFIG TRUE PC_PACKAGE_NAMES libglog)
|
2021-07-23 04:45:35 +08:00
|
|
|
# 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})
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1255,8 +1251,7 @@ endmacro()
|
2021-07-23 04:45:35 +08:00
|
|
|
if(ARROW_NEED_GFLAGS)
|
|
|
|
set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0")
|
|
|
|
resolve_dependency(gflags
|
|
|
|
- HAVE_ALT
|
|
|
|
- TRUE
|
|
|
|
+ USE_CONFIG TRUE
|
|
|
|
REQUIRED_VERSION
|
|
|
|
${ARROW_GFLAGS_REQUIRED_VERSION}
|
|
|
|
IS_RUNTIME_DEPENDENCY
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1355,9 +1350,10 @@ endmacro()
|
|
|
|
if(ARROW_WITH_THRIFT)
|
|
|
|
# We already may have looked for Thrift earlier, when considering whether
|
|
|
|
# to build Boost, so don't look again if already found.
|
|
|
|
- if(NOT Thrift_FOUND)
|
|
|
|
+ if(TRUE)
|
2021-07-23 04:45:35 +08:00
|
|
|
# Thrift c++ code generated by 0.13 requires 0.11 or greater
|
2021-08-05 18:01:46 +08:00
|
|
|
resolve_dependency(Thrift
|
|
|
|
+ USE_CONFIG TRUE
|
|
|
|
REQUIRED_VERSION
|
|
|
|
0.11.0
|
|
|
|
PC_PACKAGE_NAMES
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1366,6 +1362,14 @@ 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)
|
|
|
|
@@ -1480,6 +1484,7 @@ if(ARROW_WITH_PROTOBUF)
|
2021-07-23 04:45:35 +08:00
|
|
|
set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1")
|
|
|
|
endif()
|
2021-08-05 18:01:46 +08:00
|
|
|
resolve_dependency(Protobuf
|
|
|
|
+ USE_CONFIG TRUE
|
|
|
|
REQUIRED_VERSION
|
|
|
|
${ARROW_PROTOBUF_REQUIRED_VERSION}
|
|
|
|
PC_PACKAGE_NAMES
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1490,6 +1495,10 @@ if(ARROW_WITH_PROTOBUF)
|
2021-07-23 04:45:35 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# TODO: Don't use global includes but rather target_include_directories
|
|
|
|
+ if (TARGET protobuf::libprotobuf)
|
|
|
|
+ get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf
|
|
|
|
+ INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ endif()
|
|
|
|
include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})
|
|
|
|
|
|
|
|
if(TARGET arrow::protobuf::libprotobuf)
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1538,12 +1547,18 @@ if(ARROW_WITH_PROTOBUF)
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
# Log protobuf paths as we often see issues with mixed sources for
|
|
|
|
# the libraries and protoc.
|
|
|
|
+ if (NOT TARGET protobuf::protoc)
|
|
|
|
get_target_property(PROTOBUF_PROTOC_EXECUTABLE ${ARROW_PROTOBUF_PROTOC}
|
|
|
|
IMPORTED_LOCATION)
|
|
|
|
+ endif()
|
|
|
|
message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}")
|
|
|
|
# Protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake
|
|
|
|
message(STATUS "Found libprotoc: ${Protobuf_PROTOC_LIBRARY}")
|
|
|
|
+ if (NOT TARGET protobuf::libprotobuf)
|
|
|
|
get_target_property(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF} IMPORTED_LOCATION)
|
|
|
|
+ else()
|
|
|
|
+ set(PROTOBUF_LIBRARY protobuf::libprotobuf)
|
|
|
|
+ endif()
|
|
|
|
message(STATUS "Found libprotobuf: ${PROTOBUF_LIBRARY}")
|
|
|
|
message(STATUS "Found protobuf headers: ${PROTOBUF_INCLUDE_DIR}")
|
|
|
|
endif()
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -1954,7 +1969,7 @@ endmacro()
|
2021-07-23 04:45:35 +08:00
|
|
|
if(ARROW_WITH_RAPIDJSON)
|
|
|
|
set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0")
|
|
|
|
resolve_dependency(RapidJSON
|
|
|
|
- HAVE_ALT
|
|
|
|
+ USE_CONFIG
|
|
|
|
TRUE
|
|
|
|
REQUIRED_VERSION
|
|
|
|
${ARROW_RAPIDJSON_REQUIRED_VERSION}
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -2093,10 +2108,11 @@ macro(build_lz4)
|
2021-07-23 04:45:35 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(ARROW_WITH_LZ4)
|
2021-08-05 18:01:46 +08:00
|
|
|
- resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4)
|
2021-07-23 04:45:35 +08:00
|
|
|
+ set(lz4_SOURCE "SYSTEM")
|
2021-08-05 18:01:46 +08:00
|
|
|
+ resolve_dependency(lz4 USE_CONFIG TRUE PC_PACKAGE_NAMES liblz4)
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
# TODO: Don't use global includes but rather target_include_directories
|
|
|
|
- get_target_property(LZ4_INCLUDE_DIR LZ4::lz4 INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
+ get_target_property(LZ4_INCLUDE_DIR lz4::lz4 INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
include_directories(SYSTEM ${LZ4_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -2160,7 +2176,7 @@ endmacro()
|
2021-07-23 04:45:35 +08:00
|
|
|
if(ARROW_WITH_ZSTD)
|
2021-08-05 18:01:46 +08:00
|
|
|
# ARROW-13384: ZSTD_minCLevel was added in v1.4.0, required by ARROW-13091
|
|
|
|
resolve_dependency(zstd
|
|
|
|
- PC_PACKAGE_NAMES
|
|
|
|
+ USE_CONFIG TRUE PC_PACKAGE_NAMES
|
|
|
|
libzstd
|
|
|
|
REQUIRED_VERSION
|
|
|
|
1.4.0)
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -2343,9 +2359,8 @@ macro(build_utf8proc)
|
2021-07-23 04:45:35 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(ARROW_WITH_UTF8PROC)
|
2021-08-05 18:01:46 +08:00
|
|
|
- resolve_dependency(utf8proc
|
|
|
|
- REQUIRED_VERSION
|
|
|
|
- "2.2.0"
|
|
|
|
+ resolve_dependency(unofficial-utf8proc
|
|
|
|
+ USE_CONFIG TRUE
|
|
|
|
PC_PACKAGE_NAMES
|
|
|
|
libutf8proc)
|
2021-07-23 04:45:35 +08:00
|
|
|
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -2353,7 +2368,7 @@ if(ARROW_WITH_UTF8PROC)
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
# TODO: Don't use global definitions but rather
|
|
|
|
# target_compile_definitions or target_link_libraries
|
|
|
|
- get_target_property(UTF8PROC_COMPILER_DEFINITIONS utf8proc::utf8proc
|
|
|
|
+ get_target_property(UTF8PROC_COMPILER_DEFINITIONS utf8proc
|
|
|
|
INTERFACE_COMPILER_DEFINITIONS)
|
|
|
|
if(UTF8PROC_COMPILER_DEFINITIONS)
|
|
|
|
add_definitions(-D${UTF8PROC_COMPILER_DEFINITIONS})
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -2361,7 +2376,7 @@ if(ARROW_WITH_UTF8PROC)
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
# TODO: Don't use global includes but rather
|
|
|
|
# target_include_directories or target_link_libraries
|
|
|
|
- get_target_property(UTF8PROC_INCLUDE_DIR utf8proc::utf8proc
|
|
|
|
+ get_target_property(UTF8PROC_INCLUDE_DIR utf8proc
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
include_directories(SYSTEM ${UTF8PROC_INCLUDE_DIR})
|
|
|
|
endif()
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -3270,7 +3285,7 @@ endmacro()
|
2021-07-23 04:45:35 +08:00
|
|
|
|
|
|
|
macro(build_grpc)
|
2021-08-05 18:01:46 +08:00
|
|
|
resolve_dependency(c-ares
|
|
|
|
- HAVE_ALT
|
|
|
|
+ USE_CONFIG
|
|
|
|
TRUE
|
|
|
|
PC_PACKAGE_NAMES
|
|
|
|
libcares)
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -3493,7 +3508,7 @@ endmacro()
|
2021-07-23 04:45:35 +08:00
|
|
|
if(ARROW_WITH_GRPC)
|
|
|
|
set(ARROW_GRPC_REQUIRED_VERSION "1.17.0")
|
|
|
|
resolve_dependency(gRPC
|
|
|
|
- HAVE_ALT
|
|
|
|
+ USE_CONFIG
|
|
|
|
TRUE
|
|
|
|
REQUIRED_VERSION
|
2021-08-05 18:01:46 +08:00
|
|
|
${ARROW_GRPC_REQUIRED_VERSION}
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -3503,6 +3518,10 @@ if(ARROW_WITH_GRPC)
|
2021-07-23 04:45:35 +08:00
|
|
|
# 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)
|
|
|
|
+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.")
|
|
|
|
+ set(CMAKE_CXX_STANDARD 17)
|
|
|
|
+ endif()
|
|
|
|
|
|
|
|
if(GRPC_VENDORED)
|
|
|
|
set(GRPCPP_PP_INCLUDE TRUE)
|
2021-12-09 06:05:15 +08:00
|
|
|
@@ -4019,7 +4038,8 @@ if(ARROW_S3)
|
|
|
|
s3
|
|
|
|
transfer
|
|
|
|
identity-management
|
|
|
|
- sts)
|
|
|
|
+ sts
|
|
|
|
+ CONFIG)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Restore previous value of BUILD_SHARED_LIBS
|
2021-07-23 04:45:35 +08:00
|
|
|
diff --git a/cpp/src/arrow/adapters/orc/CMakeLists.txt b/cpp/src/arrow/adapters/orc/CMakeLists.txt
|
2021-08-05 18:01:46 +08:00
|
|
|
index ca901b07d..4512a175f 100644
|
2021-07-23 04:45:35 +08:00
|
|
|
--- a/cpp/src/arrow/adapters/orc/CMakeLists.txt
|
|
|
|
+++ b/cpp/src/arrow/adapters/orc/CMakeLists.txt
|
|
|
|
@@ -29,7 +29,7 @@ set(ORC_MIN_TEST_LIBS
|
|
|
|
GTest::gtest_main
|
|
|
|
GTest::gtest
|
|
|
|
Snappy::snappy
|
|
|
|
- LZ4::lz4
|
|
|
|
+ lz4::lz4
|
|
|
|
ZLIB::ZLIB)
|
|
|
|
|
|
|
|
if(ARROW_BUILD_STATIC)
|