From: Viktor Szakats Date: Sat, 5 Oct 2024 12:01:49 +0000 (+0200) Subject: cmake: stop adding dependency headers to global `CMAKE_REQUIRED_INCLUDES` X-Git-Tag: curl-8_11_0~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=447bcea5a4e1d89bb376bab6ef0c6eb7fc4c9ad5;p=thirdparty%2Fcurl.git cmake: stop adding dependency headers to global `CMAKE_REQUIRED_INCLUDES` It was done for `zlib`, `brotli`, `libpsl`, `libssh2`, `wolfssh` (a copy-paste case for `wolfssh`). Feature detections should not rely by default on dependency headers. There is no evidence they do now. If it becomes necessary, headers should added for the duration of the feature check. Ref: 118977f19d2d7e842bdf4424c7cfbc5991781412 Cherry-picked from #15157 Closes #15252 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ee2e6d0904..3594be790a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -744,7 +744,6 @@ if(ZLIB_FOUND) # get our dependencies transitively. list(APPEND CURL_LIBS ZLIB::ZLIB) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "zlib") - list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) endif() option(CURL_BROTLI "Use brotli" OFF) @@ -756,7 +755,6 @@ if(CURL_BROTLI) list(APPEND CURL_LIBS ${BROTLI_LIBRARIES}) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libbrotlidec") include_directories(SYSTEM ${BROTLI_INCLUDE_DIRS}) - list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS}) endif() endif() @@ -1106,7 +1104,6 @@ if(CURL_USE_LIBPSL) if(LIBPSL_FOUND) list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl") - list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIRS}") include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS}) set(USE_LIBPSL ON) else() @@ -1124,7 +1121,6 @@ if(CURL_USE_LIBSSH2) if(LIBSSH2_FOUND) list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES}) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh2") - list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIRS}") include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS}) set(USE_LIBSSH2 ON) endif() @@ -1157,7 +1153,6 @@ if(NOT USE_LIBSSH2 AND NOT USE_LIBSSH AND CURL_USE_WOLFSSH) find_package(WolfSSH) if(WOLFSSH_FOUND) list(APPEND CURL_LIBS ${WOLFSSH_LIBRARIES}) - list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSH_INCLUDE_DIRS}") include_directories(SYSTEM ${WOLFSSH_INCLUDE_DIRS}) set(USE_WOLFSSH ON) endif()