proost commented on code in PR #1198:
URL: https://github.com/apache/iceberg-cpp/pull/1198#discussion_r4768717977
##########
cmake_modules/IcebergThirdpartyToolchain.cmake:
##########
@@ -902,16 +902,86 @@ endfunction()
# ----------------------------------------------------------------------
# Zstd
+#
function(resolve_zstd_dependency)
- find_package(zstd CONFIG)
- if(zstd_FOUND)
+ prepare_fetchcontent()
+
+ set(ZSTD_BUILD_PROGRAMS OFF)
+ set(ZSTD_BUILD_TESTS OFF)
+ set(ZSTD_BUILD_SHARED OFF)
+ set(ZSTD_BUILD_STATIC ON)
+ set(ZSTD_MULTITHREAD_SUPPORT OFF)
+
+ set(ICEBERG_ZSTD_BUILD_VERSION "1.5.7")
+ set(ICEBERG_ZSTD_BUILD_SHA256_CHECKSUM
+ "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3")
+
+ if(DEFINED ENV{ICEBERG_ZSTD_URL})
+ set(ZSTD_URL "$ENV{ICEBERG_ZSTD_URL}")
+ else()
+ set(ZSTD_URL
+
"https://github.com/facebook/zstd/releases/download/v${ICEBERG_ZSTD_BUILD_VERSION}/zstd-${ICEBERG_ZSTD_BUILD_VERSION}.tar.gz"
+ )
+ endif()
+
+ fetchcontent_declare(zstd
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${ZSTD_URL}
+ URL_HASH "SHA256=${ICEBERG_ZSTD_BUILD_SHA256_CHECKSUM}"
+ SOURCE_SUBDIR
+ build/cmake
+ FIND_PACKAGE_ARGS
+ NAMES
+ zstd
+ CONFIG)
+ fetchcontent_makeavailable(zstd)
+
+ if(zstd_SOURCE_DIR)
+ set(ZSTD_VENDORED TRUE)
+ set_target_properties(libzstd_static PROPERTIES OUTPUT_NAME
"iceberg_vendored_zstd"
+ POSITION_INDEPENDENT_CODE
ON)
+ install(TARGETS libzstd_static
Review Comment:
Nice catch!
[9dd0631](https://github.com/apache/iceberg-cpp/pull/1198/commits/9dd0631fbae3384f4fe6031c0e06d1a65e705ed3)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]