From 4bf5a9322626e95e3717e43de7616c0a256179eb Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Thu, 9 Jan 2025 11:52:48 -0600 Subject: [PATCH] chore: Fall back on shared libzstd if libzstd_static is not available (#704) This PR updates the CMake such that it works in conda after a `conda install zstd` (which doesn't provide `libzstd_static`, but does provide `libzstd`). This is needed to unskip the integration tests for zstd because the integration image uses conda ( https://github.com/apache/arrow/pull/45205 ). Previous commits tested https://github.com/apache/arrow/pull/45205 by specifically pulling that branch instead of apache/arrow. When zstd is installed...the tests pass! --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c77007d2a..c689b5a3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,14 @@ if(NANOARROW_IPC) if(NANOARROW_IPC_WITH_ZSTD) find_package(zstd REQUIRED) set(NANOARROW_IPC_EXTRA_FLAGS "-DNANOARROW_IPC_WITH_ZSTD") - set(NANOARROW_IPC_EXTRA_LIBS zstd::libzstd_static) + + # libzstd_static is not available from conda + # This could be configurable if shared zstd is a must + if(TARGET zstd::libzstd_static) + set(NANOARROW_IPC_EXTRA_LIBS zstd::libzstd_static) + else() + set(NANOARROW_IPC_EXTRA_LIBS zstd::libzstd) + endif() endif() if(NOT NANOARROW_BUNDLE)