Skip to content

Commit 1957376

Browse files
fix: add bundled S3 platform link dependencies (#964)
With a bundled AWS SDK, the installed iceberg-config.cmake recreates Arrow::arrow_bundled_dependencies but did not link the macOS frameworks and Windows system libraries the bundled AWS libraries need, so static consumers failed to link. Link them as Arrow's ArrowConfig.cmake does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a810516 commit 1957376

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎src/iceberg/iceberg-config.cmake.in‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@")
4141
set(ICEBERG_CXX20_COMPAT @ICEBERG_CXX20_COMPAT_VALUE@)
42+
set(ICEBERG_AWSSDK_BUNDLED "@ICEBERG_AWSSDK_BUNDLED@")
4243
set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@")
4344

4445
# Extra args forwarded to find_dependency() for specific dependencies.
@@ -96,6 +97,33 @@ if(TARGET iceberg::arrow_static)
9697
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
9798
)
9899
endforeach()
100+
101+
# Arrow's bundled AWS libraries require platform-specific system libraries.
102+
if(ICEBERG_AWSSDK_BUNDLED)
103+
if(APPLE)
104+
find_library(CORE_FOUNDATION CoreFoundation)
105+
target_link_libraries(Arrow::arrow_bundled_dependencies
106+
INTERFACE ${CORE_FOUNDATION})
107+
find_library(NETWORK Network)
108+
target_link_libraries(Arrow::arrow_bundled_dependencies
109+
INTERFACE ${NETWORK})
110+
find_library(SECURITY Security)
111+
target_link_libraries(Arrow::arrow_bundled_dependencies
112+
INTERFACE ${SECURITY})
113+
elseif(WIN32)
114+
# Unlike Arrow, also link crypt32, which aws-c-io's Windows TLS code uses.
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+
"crypt32.lib")
125+
endif()
126+
endif()
99127
endif()
100128

101129
if(TARGET iceberg::parquet_static)

0 commit comments

Comments
 (0)