diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7d9c5c7..33afd70 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -705,7 +705,7 @@ endif() 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") @@ -721,9 +721,9 @@ if(ARROW_WITH_BZ2) 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() @@ -793,10 +793,10 @@ if(ARROW_WITH_OPENTELEMETRY) 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 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() @@ -1061,7 +1064,21 @@ endmacro() if(ARROW_WITH_SNAPPY) resolve_dependency(Snappy PC_PACKAGE_NAMES snappy) if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND) + get_target_property(SNAPPY_IMPLIB_DEBUG Snappy::snappy IMPORTED_IMPLIB_DEBUG) + get_target_property(SNAPPY_LIB_DEBUG Snappy::snappy IMPORTED_LOCATION_DEBUG) + get_target_property(SNAPPY_IMPLIB_RELEASE Snappy::snappy IMPORTED_IMPLIB_RELEASE) + get_target_property(SNAPPY_LIB_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE) + if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND SNAPPY_IMPLIB_DEBUG) + set(SNAPPY_LIB "${SNAPPY_IMPLIB_DEBUG}") + elseif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND SNAPPY_LIB_DEBUG) + set(SNAPPY_LIB "${SNAPPY_LIB_DEBUG}") + elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND SNAPPY_IMPLIB_RELEASE) + set(SNAPPY_LIB "${SNAPPY_IMPLIB_RELEASE}") + elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND SNAPPY_LIB_RELEASE) + set(SNAPPY_LIB "${SNAPPY_LIB_RELEASE}") + else() get_target_property(SNAPPY_LIB Snappy::snappy IMPORTED_LOCATION) + endif() string(APPEND ARROW_PC_LIBS_PRIVATE " ${SNAPPY_LIB}") endif() # TODO: Don't use global includes but rather target_include_directories @@ -1129,10 +1132,14 @@ macro(build_brotli) endmacro() if(ARROW_WITH_BROTLI) - resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc) + set(Brotli_SOURCE SYSTEM) + resolve_dependency(unofficial-brotli USE_CONFIG TRUE PC_PACKAGE_NAMES libbrotlidec libbrotlienc) # TODO: Don't use global includes but rather target_include_directories - get_target_property(BROTLI_INCLUDE_DIR Brotli::brotlicommon + get_target_property(BROTLI_INCLUDE_DIR unofficial::brotli::brotlicommon INTERFACE_INCLUDE_DIRECTORIES) + if(NOT BROTLI_INCLUDE_DIR) + get_target_property(BROTLI_INCLUDE_DIR unofficial::brotli::brotlicommon-static INTERFACE_INCLUDE_DIRECTORIES) + endif() include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) endif() @@ -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) @@ -2260,10 +2276,11 @@ macro(build_lz4) endmacro() if(ARROW_WITH_LZ4) - resolve_dependency(Lz4 PC_PACKAGE_NAMES liblz4) + set(Lz4_SOURCE SYSTEM) + resolve_dependency(lz4 USE_CONFIG TRUE PC_PACKAGE_NAMES liblz4) # 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() @@ -2517,9 +2534,8 @@ macro(build_utf8proc) endmacro() if(ARROW_WITH_UTF8PROC) - resolve_dependency(utf8proc - REQUIRED_VERSION - "2.2.0" + set(utf8proc_SOURCE SYSTEM) + resolve_dependency(unofficial-utf8proc PC_PACKAGE_NAMES libutf8proc) @@ -2527,7 +2543,7 @@ if(ARROW_WITH_UTF8PROC) # 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}) @@ -2535,7 +2551,7 @@ if(ARROW_WITH_UTF8PROC) # 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() @@ -3719,6 +3735,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) diff --git a/cpp/src/arrow/adapters/orc/CMakeLists.txt b/cpp/src/arrow/adapters/orc/CMakeLists.txt index b1b6847..444a45e 100644 --- a/cpp/src/arrow/adapters/orc/CMakeLists.txt +++ b/cpp/src/arrow/adapters/orc/CMakeLists.txt @@ -30,7 +30,7 @@ set(ORC_MIN_TEST_LIBS GTest::gtest_main GTest::gtest Snappy::snappy - LZ4::lz4 + lz4::lz4 ZLIB::ZLIB) if(ARROW_BUILD_STATIC)