Skip to content

Commit c9371e7

Browse files
Sreesh Maheshwarclaude
andcommitted
fix: add platform link deps for Arrow bundled S3 libraries in CMake config
When iceberg-cpp is built with ICEBERG_S3=ON using vendored Arrow, arrow_bundled_dependencies contains the AWS SDK C libraries which depend on platform-specific system libraries (CoreFoundation, Security, Network on macOS; winhttp, bcrypt, etc. on Windows). Without declaring these as transitive dependencies on the IMPORTED target, downstream consumers get unresolved symbols at link time. This mirrors Arrow's own ArrowConfig.cmake.in handling of the same issue for aws-c-common bundled dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 44df48d commit c9371e7

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/iceberg/iceberg-config.cmake.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@PACKAGE_INIT@
3333

3434
set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@")
35+
set(ICEBERG_S3 "@ICEBERG_S3@")
3536
set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@")
3637

3738
include(CMakeFindDependencyMacro)
@@ -93,6 +94,35 @@ if(TARGET iceberg::arrow_static)
9394
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
9495
)
9596
endforeach()
97+
98+
# When ICEBERG_S3 is enabled, Arrow's bundled static archive includes the
99+
# AWS SDK C libraries (aws-c-common, etc.) which depend on platform-specific
100+
# system libraries. Without these, downstream consumers get unresolved
101+
# symbols at link time.
102+
# Reference: Arrow's ArrowConfig.cmake.in handles this identically.
103+
# https://github.com/apache/arrow/blob/main/cpp/src/arrow/ArrowConfig.cmake.in
104+
if(ICEBERG_S3)
105+
if(APPLE)
106+
find_library(CORE_FOUNDATION CoreFoundation)
107+
target_link_libraries(Arrow::arrow_bundled_dependencies
108+
INTERFACE ${CORE_FOUNDATION})
109+
find_library(SECURITY Security)
110+
target_link_libraries(Arrow::arrow_bundled_dependencies
111+
INTERFACE ${SECURITY})
112+
find_library(NETWORK Network)
113+
target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${NETWORK})
114+
elseif(WIN32)
115+
target_link_libraries(Arrow::arrow_bundled_dependencies
116+
INTERFACE "winhttp.lib"
117+
"bcrypt.lib"
118+
"wininet.lib"
119+
"userenv.lib"
120+
"version.lib"
121+
"ncrypt.lib"
122+
"Secur32.lib"
123+
"Shlwapi.lib")
124+
endif()
125+
endif()
96126
endif()
97127

98128
if(TARGET iceberg::parquet_static)

0 commit comments

Comments
 (0)