cmake: limit pkg-config
to UNIX and MSVC+vcpkg by default
#14575
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Limit
pkg-config
to UNIX and MSVC with vcpkg, by default. Compared tocurl 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-crossMINGW, or all MINGW).
In the meantime everyone is free to override the default and test their
build with
pkg-config
by setting theCURL_USE_PKGCONFIG=ON
CMakeoption.
Peeking into CMake's built-in Find modules: Around 10% support
pkg-config
, some limited toUNIX
, some guarded with package-specificflags, some unguarded:
Though we tested the waters in 8.9.1 via the libidn2 dependency (
ON
by default withpkg-config
), I'm still concerned that unlockingpkg-config
almost everywhere (for alldependencies this time) might be overshooting the target, causing fallouts and manual
opt-out in more cases than ideal.
I also reckon that there has been a lot of changes already around CMake in this release cycle,
so unlocking
pkg-config
now may be too much to handle at once.Thus, this PR limits
pkg-config
to UNIX and MSVC with vcpkg, by default. Compared to8.9.1, this unlocks
pkg-config
on MSVC with vcpkg.Nobody has been publicly complaining about missing
pkg-config
on their platform.If anyone does, or we have a future release with fewer changes all around, we might
unlock this by default for more targets (e.g. 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 theCURL_USE_PKGCONFIG=ON
CMake option.Let me know what you think!
edit:
pkg-config
support does not break curl under MSYS/MINGW. Ref: #14575 (comment)