From a5f120df06a2a3f0c3a42ccae3ac8d754bc45b09 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 7 Feb 2025 13:15:57 +0100 Subject: [PATCH] cmake: respect `GNUTLS_CFLAGS` when detected via `pkg-config` Closes #16242 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ec0792c31..38d7b67478 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -838,6 +838,10 @@ if(CURL_USE_GNUTLS) pkg_check_modules(GNUTLS "gnutls") if(GNUTLS_FOUND) set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES}) + string(REPLACE ";" " " GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") + if(GNUTLS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${GNUTLS_CFLAGS}") + endif() endif() endif() if(NOT GNUTLS_FOUND) -- 2.47.3