Skip to content
Merged
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
41 changes: 30 additions & 11 deletions cmake_modules/IcebergThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ function(resolve_arrow_dependency)
set(ARROW_DEPENDENCY_SOURCE
"BUNDLED"
CACHE STRING "" FORCE)
set(ARROW_WITH_ZLIB
ON
CACHE BOOL "" FORCE)
set(ZLIB_SOURCE
"SYSTEM"
CACHE STRING "" FORCE)

fetchcontent_declare(VendoredArrow
${FC_DECLARE_COMMON_OPTIONS}
Expand Down Expand Up @@ -153,10 +159,6 @@ function(resolve_arrow_dependency)
PARENT_SCOPE)
endfunction()

if(ICEBERG_BUILD_BUNDLE)
resolve_arrow_dependency()
endif()

# ----------------------------------------------------------------------
# Apache Avro

Expand Down Expand Up @@ -211,7 +213,6 @@ function(resolve_avro_dependency)
if(Snappy_FOUND)
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Snappy)
endif()
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB)
else()
set(AVRO_VENDORED FALSE)
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Avro)
Expand All @@ -225,10 +226,6 @@ function(resolve_avro_dependency)
PARENT_SCOPE)
endfunction()

if(ICEBERG_BUILD_BUNDLE)
resolve_avro_dependency()
endif()

# ----------------------------------------------------------------------
# Nanoarrow

Expand All @@ -251,8 +248,6 @@ function(resolve_nanoarrow_dependency)
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
endfunction()

resolve_nanoarrow_dependency()

# ----------------------------------------------------------------------
# nlohmann-json

Expand Down Expand Up @@ -284,4 +279,28 @@ function(resolve_nlohmann_json_dependency)
LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR}")
endfunction()

# ----------------------------------------------------------------------
# zlib

function(resolve_zlib_dependency)
# use system zlib, zlib is required by arrow and avro
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES ZLIB)
message(STATUS "ZLIB_FOUND ZLIB_LIBRARIES:${ZLIB_LIBRARIES} ZLIB_INCLUDE_DIR:${ZLIB_INCLUDE_DIR}"
)
set(ICEBERG_SYSTEM_DEPENDENCIES
${ICEBERG_SYSTEM_DEPENDENCIES}
PARENT_SCOPE)
endif()

endfunction()

resolve_zlib_dependency()
resolve_nanoarrow_dependency()
resolve_nlohmann_json_dependency()

if(ICEBERG_BUILD_BUNDLE)
resolve_arrow_dependency()
resolve_avro_dependency()
endif()
Loading