Commits


Tobias Mayer authored and Sutou Kouhei committed 81d3f2657b1
ARROW-9412: [C++] Add non-bundled dependencies to INTERFACE_LINK_LIBRARIES of static libarrow This adds support for using the `arrow_static` CMake target with system static libraries. This adds the following CMake options: * `ARROW_DEPENDENCY_USE_SHARED` (`ON` by default): The default value of `ARROW_*_USE_SHARED` except `ARROW_THRIFT_USE_SHARED` on Windows. * `ARROW_BZ2_USE_SHARED`: Use shared library of bzip2. * `ARROW_LZ4_USE_SHARED`: Use shared library of LZ4. * `ARROW_THRIFT_USE_SHARED` (`OFF` by default on Windows): Use shared library of libthrift. This is `OFF` by default on Windows because it seems that Thrift's DLL support isn't well for not. * `ARROW_UTF8PROC_USE_SHARED`: Use shared library of utf8proc. * `ARROW_SNAPPY_USE_SHARED`: Use shared library of Snappy. * `ARROW_ZSTD_USE_SHARED`: Use shared library of ZStandard. Note that users must specify `ARROW_*_USE_SHARED=OFF` explicitly when they want to use static library. This is a backward incompatible change for some cases. For example, users can use shared library or static library without specifying any options before this change. Because old `FindLz4.cmake` find both shared library and static library. Note that upstream `SnappyConfig.cmake` and `zstdConfig.cmake` are never used with this change. We always use our `Find*.cmake` for them to process `ARROW_*_USE_SHARED`. Note that the `ZSTD_SOURCE` CMake option is renamed to `zstd_SOURCE`. Some dependencies don't support static linking with `ARROW_*_USE_SHARED=OFF` yes. For example, gRPC may ignore it. If `gRPCConfig.cmake` is installed, our `FindgRPCAlt.cmake` isn't used. It means that `ARROW_GRPC_USE_SHARED=OFF` is ignored. We can work on this as further tasks. RE2 is only required by Gandiva but it's searched by `find_package(Arrow)` not `find_package(Gandiva)`. It should be fixed by a follow-up task. Closes #7842 from tobim/ARROW-9412-unbundled-static-dependencies Lead-authored-by: Tobias Mayer <tobim@fastmail.fm> Co-authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>