From 7ac8694aaea7af76d5ab5db52ad392878ada5f8f Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 10 Feb 2026 15:43:42 +0800 Subject: [PATCH] Fix static c-ares detection for newer Debian/Ubuntu releases c-ares >= 1.27 renamed the static library from libcares.a to libcares_static.a. Search for both names so the static build works on older distros (libcares.a) and newer ones (libcares_static.a). Fixes #3024 Co-Authored-By: Claude Opus 4.6 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80503cb2..e12daccf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,7 +105,7 @@ find_library(LIBMBEDTLS libmbedtls.a) find_library(LIBMBEDCRYPTO libmbedcrypto.a HINTS ${_MBEDTLS_LIB_DIR} NO_DEFAULT_PATH) find_library(LIBMBEDCRYPTO libmbedcrypto.a) find_library(LIBEV libev.a) -find_library(LIBUDNS libcares.a) +find_library(LIBUDNS NAMES libcares.a libcares_static.a) find_library(LIBPCRE2 libpcre2-8.a) # Dependencies we need for static and shared