]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: limit `pkg-config` to UNIX and MSVC+vcpkg by default
authorViktor Szakats <commit@vsz.me>
Fri, 16 Aug 2024 23:08:45 +0000 (01:08 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 19 Aug 2024 22:50:11 +0000 (00:50 +0200)
Limits `pkg-config` to UNIX and MSVC with vcpkg, by default. Compared to
curl 8.9.1, this unlocks `pkg-config` on MSVC with vcpkg.

This condition might be updated in the future depending on where
`pkg-config` can be useful without breaking things. (e.g. to non-cross
MINGW, or all MINGW).

In the meantime everyone is free to override the default and test their
build with `pkg-config` by setting the `CURL_USE_PKGCONFIG=ON` CMake
option.

Closes #14575

CMake/curl-config.cmake.in
CMakeLists.txt

index 5be5d7103a0eaccadfd8a6673726ef2d55d743c1..11f13d03f71c13bc2f0de28d9bf6ae19f967cd1a 100644 (file)
@@ -24,7 +24,7 @@
 @PACKAGE_INIT@
 
 if(NOT DEFINED CURL_USE_PKGCONFIG)
-  if(NOT MSVC OR VCPKG_TOOLCHAIN)
+  if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN))  # Keep this in sync with root CMakeLists.txt
     set(CURL_USE_PKGCONFIG ON)
   else()
     set(CURL_USE_PKGCONFIG OFF)
index abf6af30a760f76a36451a5ea32018919988c121..269a6e286ff5fd211171e68f62bd95e8f2d2c0f3 100644 (file)
@@ -208,7 +208,7 @@ else()
 endif()
 
 # Override to force-disable or force-enable the use of pkg-config.
-if(NOT MSVC OR VCPKG_TOOLCHAIN)
+if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN))  # Keep this in sync with CMake/curl-config.cmake.in
   set(_curl_use_pkgconfig_default ON)
 else()
   set(_curl_use_pkgconfig_default OFF)