From cbff39e35c9d41c1f460387666b31b887a073c4a Mon Sep 17 00:00:00 2001 From: Sreesh Maheshwar Date: Thu, 15 Oct 2026 21:34:04 +0100 Subject: [PATCH] fix: add bundled S3 platform link dependencies 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 --- src/iceberg/iceberg-config.cmake.in | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 4f440362e..1bdebef48 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -39,6 +39,7 @@ set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@") set(ICEBERG_CXX20_COMPAT @ICEBERG_CXX20_COMPAT_VALUE@) +set(ICEBERG_AWSSDK_BUNDLED "@ICEBERG_AWSSDK_BUNDLED@") set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@") # Extra args forwarded to find_dependency() for specific dependencies. @@ -103,6 +104,31 @@ if(TARGET iceberg::arrow_static) "${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}" ) endforeach() + + # Arrow's bundled AWS libraries require platform-specific system libraries. + if(ICEBERG_AWSSDK_BUNDLED) + if(APPLE) + find_library(CORE_FOUNDATION CoreFoundation) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${CORE_FOUNDATION}) + find_library(NETWORK Network) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${NETWORK}) + find_library(SECURITY Security) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE ${SECURITY}) + elseif(WIN32) + target_link_libraries(Arrow::arrow_bundled_dependencies + INTERFACE "winhttp.lib" + "bcrypt.lib" + "wininet.lib" + "userenv.lib" + "version.lib" + "ncrypt.lib" + "Secur32.lib" + "Shlwapi.lib") + endif() + endif() endif() if(TARGET iceberg::parquet_static)