KHARSHAVARDHAN-eng opened a new pull request, #50764: URL: https://github.com/apache/arrow/pull/50764
### Rationale for this change In Apache Arrow's CMake build system, third-party dependency resolution and static library interface target registration were decoupled across two separate locations: 1. `resolve_dependency()` in `cpp/cmake_modules/ThirdpartyToolchain.cmake` 2. Manual `ARROW_STATIC_INSTALL_INTERFACE_LIBS` checks in `cpp/src/arrow/CMakeLists.txt` Because these declarations were separate, developers adding or updating a dependency in `ThirdpartyToolchain.cmake` frequently forgot to update `ARROW_STATIC_INSTALL_INTERFACE_LIBS` in `cpp/src/arrow/CMakeLists.txt` (e.g. `simdjson` in GH-50716 / GH-50566). As a result, static builds (`-DARROW_DEPENDENCY_SOURCE=SYSTEM`) generated exported target metadata (`ArrowTargets.cmake`) missing required transitive interface link libraries. ### What changes are included in this PR? 1. Extended the `resolve_dependency()` macro in `cpp/cmake_modules/ThirdpartyToolchain.cmake` to accept an optional `STATIC_INSTALL_INTERFACE_LIBS` argument. When a dependency is resolved as `SYSTEM`, its static interface targets are automatically appended to `ARROW_STATIC_INSTALL_INTERFACE_LIBS` (or `ARROW_FLIGHT_STATIC_INSTALL_INTERFACE_LIBS`). 2. Updated dependency resolution calls in `ThirdpartyToolchain.cmake` for `simdjson`, `Snappy`, `Brotli`, `OpenSSL`, `glog`, `Protobuf`, `ZLIB`, `lz4`, `zstd`, `re2`, `BZip2`, `utf8proc`, `opentelemetry-cpp`, `google_cloud_cpp_storage`, `orc`, and `AWSSDK`. 3. Removed redundant manual `ARROW_STATIC_INSTALL_INTERFACE_LIBS` checks from `cpp/src/arrow/CMakeLists.txt` and updated `cpp/src/arrow/flight/CMakeLists.txt`. ### Are these changes tested? Verified via CMake configurations and generated export metadata: - Configured a static build with `SYSTEM` dependencies and verified that `ArrowTargets.cmake` contains `simdjson::simdjson`, `Snappy::snappy`, `ZLIB::ZLIB`, `LZ4::lz4`, `BZip2::BZip2`, etc. in `INTERFACE_LINK_LIBRARIES` for `Arrow::arrow_static`. - Configured a bundled static build (`-DARROW_DEPENDENCY_SOURCE=BUNDLED`) and confirmed system targets do not leak into exported static interface libraries. Closes #50753 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
