]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: picky-linker fixes for openssl, ZLIB, H3 and more
authorViktor Szakats <commit@vsz.me>
Thu, 30 Mar 2023 08:55:20 +0000 (08:55 +0000)
committerViktor Szakats <commit@vsz.me>
Thu, 30 Mar 2023 08:55:20 +0000 (08:55 +0000)
commit1e3319a167d2f32d295603167486e9e88af9bb4e
tree42f6facbd9d42ce9ad23b4a884ff64182ebff63b
parentb74bba9aad024f20bf105b5d23618f1ff876ab3d
cmake: picky-linker fixes for openssl, ZLIB, H3 and more

- fix HTTP/3 support detection with OpenSSL/quictls built with ZLIB.
  (Requires curl be built with ZLIB option also.)

- fix HTTP/3 support detection with OpenSSL/quictls/LibreSSL and `ld`
  linker on Windows.

- fix HTTP/3 support detection with wolfSSL to automatically add
  `ws2_32` to the lib list on Windows. For all linkers.

- reposition ZLIB (and other compression) detection _after_ TLS
  detection, but before calling HTTP/3-support detection via
  `CheckQuicSupportInOpenSSL`.

  May be a regression from ebef55a61df0094b9790710a42f63c48e7de3c13
  May fix #10832 (Reported-by: Micah Snyder)

  This also seems to fix an odd case, where OpenSSL/quictls is correctly
  detected, but its header path is not set while compiling, breaking
  build at `src/curl_ntlm_core.c`. Reason for this remains undiscovered.

- satisfy "picky" linkers such as `ld` with MinGW, that are highly
  sensitive to lib order, by also adding brotli to the beginning of the
  lib list.

- satisfy "picky" linkers by adding certain Windows systems libs to
  the lib list for OpenSSL/LibreSSL. (Might need additional ones for
  other forks, such as `pthread` for BoringSSL.)

Note: It'd make sense to _always_ add `ws2_32`, `crypt32` (except
Windows App targets perhaps?), `bcrypt` (except old-mingw!) on Windows
at this point. They are almost always required, and if some aren't,
they are ignored by the linker with no effect on final binaries.

Closes #10857
CMakeLists.txt