Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Oct 20, 2025

Replacing a combination of custom logic in the main script and relying
on CMake's built-in Find module, with code and behavior used for
the rest of dependencies.

Also to:

  • add version detection in the non-pkg-config path.
  • make GNUTLS_INCLUDE_DIR and GNUTLS_LIBRARY take precedence over
    pkg-config. As with other dependencies.
  • document the above two configuration options.
  • prepare for cmake: define dependencies as IMPORTED interface targets #16973, which originally introduced this local Find
    module.

The local module is doing largely the same as CMake's built-in
FindGnuTLS. Differences:

  • honors CURL_USE_PKGCONFIG.
  • returns GnuTLS version for non-pkg-config detection.
  • consistently returns GNUTLS_VERSION.
    (CMake's built-in uses s different name in <3.16.)
  • CMake 3.16+ returns an imported target. curl supports 3.7,
    therefore we may only use it conditionally, which isn't worth it.

Cherry-picked from #16973

@vszakats vszakats marked this pull request as draft October 20, 2025 14:12
@github-actions github-actions bot added the build label Oct 20, 2025
@vszakats vszakats marked this pull request as ready for review October 20, 2025 14:20
@vszakats vszakats changed the title cmake: add local FindGnuTLS module cmake: add and use local FindGnuTLS module Oct 20, 2025
@vszakats vszakats closed this in 1966c86 Oct 21, 2025
@vszakats vszakats deleted the cm-find-gnutls branch October 21, 2025 12:38
vszakats added a commit that referenced this pull request Oct 22, 2025
Follow-up to 1966c86 #19163
Cherry-picked from #16973
vszakats added a commit that referenced this pull request Nov 4, 2025
…module

When GnuTLS is detected via pkg-config on a non-default path, e.g. with
Homebrew arm64 (`/opt/homebrew/`).

This was a regression from a commit made in this release cycle.

The Find module doesn't return an absolute path to the detected library
(as the former solution did), but a bare libname and a libpath. We thus
need to explicitly use the libpath while detecting a feature in GnuTLS
found this way. Syncing this with other dependencies.

Follow-up to 1966c86 #19163

Closes #19360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant