Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4405,6 +4405,41 @@ if(ARROW_BUILD_STATIC)
AND NOT WIN32)
arrow_append_pc_system_library("libxml-2.0" ARROW_LIBXML2_PC "-lxml2")
endif()
if(ARROW_GCS
AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED"
AND absl_SOURCE STREQUAL "SYSTEM")
# Bundled google-cloud-cpp needs system Abseil for static linking.
# Abseil .pc files include indirect link dependencies that -labsl_* flags omit
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add an output message if not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, added.

foreach(ARROW_GCS_ABSL_PC_PACKAGE
absl_base
absl_cord
absl_crc32c
absl_memory
absl_optional
absl_span
absl_str_format
absl_strings
absl_time
absl_variant)
pkg_check_modules(ARROW_GCS_${ARROW_GCS_ABSL_PC_PACKAGE}_PC
${ARROW_GCS_ABSL_PC_PACKAGE}
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
QUIET)
if(ARROW_GCS_${ARROW_GCS_ABSL_PC_PACKAGE}_PC_FOUND)
string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARROW_GCS_ABSL_PC_PACKAGE}")
else()
message(STATUS "No .pc for ${ARROW_GCS_ABSL_PC_PACKAGE}; "
"static pkg-config metadata may be incomplete. Consider CMake")
endif()
endforeach()
else()
message(STATUS "PkgConfig not available. Skipping Abseil dependencies from arrow.pc"
)
endif()
endif()
endif()

# ----------------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ if(ARROW_GCS)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS google-cloud-cpp::storage)
elseif(google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
if(absl_SOURCE STREQUAL "SYSTEM")
# Bundled google-cloud-cpp with system Abseil needs these for static consumers.
list(APPEND
ARROW_STATIC_INSTALL_INTERFACE_LIBS
absl::base
absl::cord
absl::crc32c
absl::memory
absl::optional
absl::span
absl::str_format
absl::strings
absl::time
absl::variant)
endif()
endif()
endif()

Expand Down
Loading