]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Revert: cmake: enable `CURL_USE_PKGCONFIG` for cross-`MINGW`
authorViktor Szakats <commit@vsz.me>
Tue, 17 Dec 2024 02:20:30 +0000 (03:20 +0100)
committerViktor Szakats <commit@vsz.me>
Tue, 17 Dec 2024 02:21:22 +0000 (03:21 +0100)
This reverts commit 39c06f7883f448c222082c0dbb3d9a4c5eae2826 #15005.

Combined with most Find modules now supporting `pkg-config`
(39c741b7b008b5959980b29ac721357ff75de3f5 #15408) this change made
mingw-cross builds fragile by picking up OS-native components. Also
adding `/usr/include` to the header path, confusing feature detection.

CMake/curl-config.cmake.in
CMakeLists.txt
docs/INSTALL-CMAKE.md

index 4612d56b4c0ff9ef971d02fcd889902c4dc4700a..aa9eb51ffd29031946f2d092e6a971a1c5ebd8db 100644 (file)
@@ -23,7 +23,7 @@
 ###########################################################################
 @PACKAGE_INIT@
 
-if(UNIX OR VCPKG_TOOLCHAIN OR MINGW)  # Keep in sync with root CMakeLists.txt
+if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING))  # Keep in sync with root CMakeLists.txt
   set(_curl_use_pkgconfig_default ON)
 else()
   set(_curl_use_pkgconfig_default OFF)
index af21d81848853bcb7d7816f2fd2d9399cd1710ce..eae5925d64abbffa090d1168db65c15710f04821 100644 (file)
@@ -279,7 +279,7 @@ else()
 endif()
 
 # Override to force-disable or force-enable the use of pkg-config.
-if(UNIX OR VCPKG_TOOLCHAIN OR MINGW)  # Keep in sync with CMake/curl-config.cmake.in
+if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING))  # Keep in sync with CMake/curl-config.cmake.in
   set(_curl_use_pkgconfig_default ON)
 else()
   set(_curl_use_pkgconfig_default OFF)
index 507d5fd48f19b4972be33428d3f5e3a0a114e9c5..ec3c876c4a71139f0c2899671e3866971ffe30ce 100644 (file)
@@ -276,7 +276,7 @@ Details via CMake
 - `CURL_USE_LIBUV`:                         Use libuv for event-based tests. Default: `OFF`
 - `CURL_USE_MBEDTLS`:                       Enable mbedTLS for SSL/TLS. Default: `OFF`
 - `CURL_USE_OPENSSL`:                       Enable OpenSSL for SSL/TLS. Default: `ON` if no other TLS backend was enabled.
-- `CURL_USE_PKGCONFIG`:                     Enable `pkg-config` to detect dependencies. Default: `ON` for Unix, vcpkg, MinGW.
+- `CURL_USE_PKGCONFIG`:                     Enable `pkg-config` to detect dependencies. Default: `ON` for Unix, vcpkg, MinGW if not cross-compiling.
 - `CURL_USE_RUSTLS`:                        Enable Rustls for SSL/TLS. Default: `OFF`
 - `CURL_USE_SCHANNEL`:                      Enable Windows native SSL/TLS (Schannel). Default: `OFF`
 - `CURL_USE_SECTRANSP`:                     Enable Apple OS native SSL/TLS (Secure Transport). Default: `OFF`