This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 8e61cdd024 GH-46231: [C++][CMake] Fix `arrow_bundled_dependencies` to
be externally accessible by FetchContent (#46232)
8e61cdd024 is described below
commit 8e61cdd0244a1c60844cb5bf301e20821862f499
Author: Gang Wu <[email protected]>
AuthorDate: Mon Apr 28 16:04:17 2025 +0800
GH-46231: [C++][CMake] Fix `arrow_bundled_dependencies` to be externally
accessible by FetchContent (#46232)
### Rationale for this change
`arrow_bundled_dependencies` is an IMPORTED library which links to
`arrow_bundled_dependencies_merge`. When arrow-cpp is used externally as a
third-party dependency via CMake `FetchContent`, target
`arrow_bundled_dependencies` is not accessible by the parent project (but
`arrow_bundled_dependencies_merge` is). It is difficult for the parent project
to locate the built product of `arrow_bundled_dependencies_merge` and install
it.
### What changes are included in this PR?
Change `IMPORTED` library `arrow_bundled_dependencies` to be `GLOBAL`.
### Are these changes tested?
- Pass all CIs.
- Verified to work by https://github.com/apache/iceberg-cpp/pull/89
### Are there any user-facing changes?
I don't think so.
* GitHub Issue: #46231
Authored-by: Gang Wu <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/cmake_modules/BuildUtils.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpp/cmake_modules/BuildUtils.cmake
b/cpp/cmake_modules/BuildUtils.cmake
index 3efd166f22..32d962b0cf 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -163,7 +163,7 @@ function(arrow_create_merged_static_lib output_target)
message(STATUS "Creating bundled static library target ${output_target} at
${output_lib_path}"
)
- add_library(${output_target} STATIC IMPORTED)
+ add_library(${output_target} STATIC IMPORTED GLOBAL)
set_target_properties(${output_target} PROPERTIES IMPORTED_LOCATION
${output_lib_path})
add_dependencies(${output_target} ${output_target}_merge)
endfunction()