Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/iceberg/iceberg-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@PACKAGE_INIT@

set(ICEBERG_BUILD_STATIC "@ICEBERG_BUILD_STATIC@")
set(ICEBERG_S3 "@ICEBERG_S3@")
set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@")

# Extra args forwarded to find_dependency() for specific dependencies.
Expand Down Expand Up @@ -102,6 +103,36 @@ if(TARGET iceberg::arrow_static)
"${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
endforeach()

# When ICEBERG_S3 is enabled, Arrow's bundled static archive includes the
# AWS SDK C libraries (aws-c-common, etc.) which depend on platform-specific
# system libraries. Without these, downstream consumers get unresolved
# symbols at link time.
# Reference: Arrow's ArrowConfig.cmake.in handles this similarly.
# https://github.com/apache/arrow/blob/main/cpp/src/arrow/ArrowConfig.cmake.in
if(ICEBERG_S3)
if(APPLE)
find_library(CORE_FOUNDATION CoreFoundation)
target_link_libraries(Arrow::arrow_bundled_dependencies
INTERFACE ${CORE_FOUNDATION})
find_library(SECURITY Security)
target_link_libraries(Arrow::arrow_bundled_dependencies
INTERFACE ${SECURITY})
find_library(NETWORK Network)
target_link_libraries(Arrow::arrow_bundled_dependencies
INTERFACE ${NETWORK})
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)
Expand Down
Loading