From f95320af0ba51e02e4e214a203db6f82709c459b Mon Sep 17 00:00:00 2001 From: Rocco Corsi <5201151+rcorsi@users.noreply.github.com> Date: Mon, 16 Feb 2026 17:22:55 -0500 Subject: [PATCH] Meta: Build zstd correctly to support clang plugins and curl 8.18.0 clang/llvm is dependent on zstd and its cmake will configure/build zstd if it is not available. This is especially the case when the clang plugins libraries are used. Curl 8.18.0 configure fails if zstd is configured by clang first as not all the required zstd libraries will be built by clang's cmake. When testing with clang_plugins enabled the zstd package will be configured before clang to create all the required libraries avoiding later cmake issues between curl 8.18.0 and zstd See https://github.com/llvm/llvm-project/issues/139666 --- Meta/CMake/clang_development.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Meta/CMake/clang_development.cmake b/Meta/CMake/clang_development.cmake index 277c56f423..7bf28e12a0 100644 --- a/Meta/CMake/clang_development.cmake +++ b/Meta/CMake/clang_development.cmake @@ -8,5 +8,14 @@ endif() set(DESIRED_CLANG_VERSION "${CMAKE_CXX_COMPILER_VERSION}") +# find zstd package before clang so that it is built fully and not +# specifically for clang's use. Clang/LLVM requires zstd and it's cmake +# will build zstd if not available, but clang's cmake will incorrectly +# build zstd for curl 8.18.0, which also depends on zstd. +# +# see https://github.com/LadybirdBrowser/ladybird/pull/7738 +# related to https://github.com/llvm/llvm-project/issues/139666 +find_package(zstd QUIET CONFIG REQUIRED) + find_package(Clang "${DESIRED_CLANG_VERSION}" QUIET REQUIRED CONFIG) find_package(LLVM "${DESIRED_CLANG_VERSION}" QUIET REQUIRED CONFIG)