Repository navigation
Open
Description
Describe the enhancement requested
When building with Static linking System dependencies we have to add the targets to ARROW_STATIC_INSTALL_INTERFACE_LIBS, otherwise we get failures like:
#50739
This usually is forgotten as is separate from other dependency declarations causing some CI failures, new PRs:
arrow/cpp/src/arrow/CMakeLists.txt
Lines 36 to 138 in d735dc9
| if(ARROW_GCS) | |
| if(google_cloud_cpp_storage_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS google-cloud-cpp::storage) | |
| endif() | |
| endif() | |
| if(ARROW_USE_OPENSSL) | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_OPENSSL_LIBS}) | |
| endif() | |
| if(ARROW_WITH_BROTLI) | |
| if(Brotli_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_BROTLI_LIBS}) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_BZ2) | |
| if(BZip2_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS BZip2::BZip2) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_LZ4) | |
| if(lz4_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS LZ4::lz4) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_SNAPPY) | |
| if(Snappy_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${Snappy_TARGET}) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_ZLIB) | |
| if(ZLIB_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ZLIB::ZLIB) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_ZSTD) | |
| if(zstd_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_ZSTD_LIBZSTD}) | |
| endif() | |
| endif() | |
| if(ARROW_ORC) | |
| if(orc_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS orc::orc) | |
| endif() | |
| endif() | |
| if(ARROW_USE_GLOG) | |
| if(glog_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS glog::glog) | |
| endif() | |
| endif() | |
| if(ARROW_S3) | |
| if(AWSSDK_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND | |
| ARROW_STATIC_INSTALL_INTERFACE_LIBS | |
| aws-cpp-sdk-identity-management | |
| aws-cpp-sdk-sts | |
| aws-cpp-sdk-cognito-identity | |
| aws-cpp-sdk-s3 | |
| aws-cpp-sdk-core) | |
| elseif(AWSSDK_SOURCE STREQUAL "BUNDLED") | |
| if(UNIX) | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) | |
| endif() | |
| endif() | |
| endif() | |
| if(ARROW_WITH_OPENTELEMETRY) | |
| if(opentelemetry_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_OPENTELEMETRY_LIBS}) | |
| endif() | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl) | |
| endif() | |
| if(ARROW_WITH_UTF8PROC) | |
| if(utf8proc_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc::utf8proc) | |
| endif() | |
| endif() | |
| if(ARROW_WITH_RE2) | |
| if(re2_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS re2::re2) | |
| endif() | |
| endif() | |
| if(ARROW_PROTOBUF_ARROW_CMAKE_PACKAGE_NAME STREQUAL "Arrow") | |
| if(Protobuf_SOURCE STREQUAL "SYSTEM") | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_PROTOBUF_LIBPROTOBUF}) | |
| endif() | |
| endif() | |
| if(ARROW_ENABLE_THREADING) | |
| list(APPEND ARROW_SHARED_PRIVATE_LINK_LIBS Threads::Threads) | |
| list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS Threads::Threads) | |
| endif() |
It would be nice if we had a more automated way of doing this (resolve_dependency?) or this would be co-located to the rest of declarations so its not forgotten.
Component(s)
C++
Activity
KHARSHAVARDHAN-eng commentedon Aug 1, 2026
Implemented the change by extending
resolve_dependency()withSTATIC_INSTALL_INTERFACE_LIBS, so static interface dependencies can now be declared alongside dependency resolution instead of being maintained separately.I also migrated the existing applicable dependencies to this mechanism and removed the corresponding duplicate declarations from the Arrow and Flight CMakeLists.
For verification, I tested both SYSTEM and BUNDLED static configurations and inspected the generated
ArrowTargets.cmaketo confirm the expected interface dependencies are propagated correctly without leaking SYSTEM targets into BUNDLED builds.I hope this covers the intended scope of #50753. If there are any changes, additional tests, or adjustments you'd prefer, I'm happy to address them. Thanks!