From 00c34a7d255dd581cc6e437d120ecf18922933f9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Jul 2025 11:25:23 -0400 Subject: [PATCH] cmCurl: Suppress curl 8.15 deprecation warning for curl 8.[3-5] workaround Curl 8.15 removed support for Secure Transport and deprecated the corresponding `CURLSSLBACKEND_SECURETRANSPORT` constant. We still need the constant in a workaround for a runtime-checked range of older curl versions. Suppress the deprecation warning at compile time. Fixes: #27086 --- Source/cmCurl.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx index 132150d5ff..ddd2feccfe 100644 --- a/Source/cmCurl.cxx +++ b/Source/cmCurl.cxx @@ -64,7 +64,23 @@ static_assert(CURL_SSLVERSION_LAST == 8, // curl 8.3.0 through 8.5.x did not re-initialize LibreSSL correctly, // so prefer the Secure Transport backend by default in those versions. if (cv->version_num >= 0x080300 && cv->version_num < 0x080600) { +# if defined(__clang__) +# define CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" +# elif defined(__GNUC__) +# define CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# endif curl_global_sslset(CURLSSLBACKEND_SECURETRANSPORT, NULL, NULL); +# if defined(CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_CLANG) +# undef CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_CLANG +# pragma clang diagnostic pop +# elif defined(CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_GCC) +# undef CM_CURL_DEPRECATED_CURLSSLBACKEND_SECURETRANSPORT_GCC +# pragma GCC diagnostic pop +# endif } } #endif