From 1e41850becc28d69dce1975f5978fcd0eb96c87f Mon Sep 17 00:00:00 2001 From: FoolHen Date: Mon, 8 Jun 2026 12:28:14 +0200 Subject: [PATCH] Fix libzip build failure due to BUILD_SHARED_LIBS collision SQLiteCpp's option(BUILD_SHARED_LIBS OFF) sets the variable in cache, which then leaks into libzip's build. libzip defaults to ON but sees the cached OFF value, causing it to attempt linking against zstd::libzstd_static which doesn't exist when only the shared library is installed (e.g., on Arch Linux). Fix by explicitly setting BUILD_SHARED_LIBS=ON before add_subdirectory(libzip). --- modules/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 69fcf98..bf4c571 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -25,5 +25,7 @@ option(BUILD_REGRESS "Build regression tests" OFF) option(BUILD_OSSFUZZ "Build fuzzers for ossfuzz" OFF) option(BUILD_EXAMPLES "Build examples" OFF) option(BUILD_DOC "Build documentation" OFF) +# Ensure BUILD_SHARED_LIBS is ON for libzip (SQLiteCpp may have set it OFF) +set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.so) instead of static ones (.a)" FORCE) add_subdirectory("libzip")