]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: add native `pkg-config` detection for mbedTLS, MSH3, Quiche, Rustls, wolfSSL
authorViktor Szakats <commit@vsz.me>
Tue, 8 Oct 2024 10:32:52 +0000 (12:32 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 10 Oct 2024 12:45:09 +0000 (14:45 +0200)
commit7bab201abe3915a0167c002f9308950cb8a06e4b
tree24675653c998c99e8951188941cc409d94ee23e6
parentae5351696f67619d18c101b54682ef849e9c94c4
cmake: add native `pkg-config` detection for mbedTLS, MSH3, Quiche, Rustls, wolfSSL

Also:
- detect and add required system libraries for Rustls on macOS and
  non-Windows.
- add Linux CMake jobs for the touched dependencies.
  Caveats:
  - MSH3 generates a broken `libmsh3.pc`, so needs manual config.
    Upstream PR: https://github.com/nibanks/msh3/pull/225
  - Rustls `.pc` file missing, so needs manual config.

An internal change worthy of mention is that we are using the lib path
and name information returned by `pkg-config` as-is. Meaning the libname
doesn't include the full path, like it's usual with native cmake
detection. The path comes separately and needs to be rolled separately.
For this we add it to targets via `link_directories()`. We also keep tab
of them in `CURL_LIBDIRS` and use that in `libcurl.pc`. Feature checks
also need to receive these paths. CMake doesn't offer
a `CMAKE_REQUIRED_*` variable for this purpose, only
a `CMAKE_REQUIRED_LINK_OPTIONS` accepting raw linker flags. Add a macro
to convert a list of paths to linker options to solve it. wolfSSL
requires this for now.

Closes #15193
.github/workflows/http3-linux.yml
.github/workflows/linux.yml
CMake/FindMSH3.cmake
CMake/FindMbedTLS.cmake
CMake/FindQuiche.cmake
CMake/FindRustls.cmake
CMake/FindWolfSSL.cmake
CMake/Macros.cmake
CMakeLists.txt