curl/CMake
Viktor Szakats 7cd400a4d2
cmake: fix original MinGW builds
1. Re-enable `HAVE_GETADDRINFO` detection on Windows

   Commit d08ee3c83d (in 2013) added logic
   that automatically assumed `getaddrinfo()` to be present for builds
   with IPv6 enabled. As it turns out, certain toolchains (e.g. original
   MinGW) by default target older Windows versions, and thus do not
   support `getaddrinfo()` out of the box. The issue was masked for
   a while by CMake builds forcing a newer Windows version, but that
   logic got deleted in commit 8ba22ffb20.
   Since then, some CI builds started failing due to IPv6 enabled,
   `HAVE_GETADDRINFO` set, but `getaddrinfo()` in fact missing.

   It also turns out that IPv6 works without `getaddrinfo()` since commit
   67a08dca27 (from 2019, via #4662). So,
   to resolve all this, we can now revert the initial commit, thus
   restoring `getaddrinfo()` detection and support IPv6 regardless of its
   outcome.

   Reported-by: Daniel Stenberg

2. Omit `bcrypt` with original MinGW

   Original (aka legacy/old) MinGW versions do not support `bcrypt`
   (introduced with Vista). We already have logic to handle that in
   `lib/rand.c` and autotools builds, where we do not call the
   unsupported API and do not link `bcrypt`, respectively, when using
   original MinGW.

   This patch ports that logic to CMake, fixing the link error:
   `c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lbcrypt`

   Ref: https://ci.appveyor.com/project/curlorg/curl/builds/44624888/job/40vle84cn4vle7s0#L508
   Regression since 76172511e7

Fixes #9214
Fixes #9393
Fixes #9395
Closes #9396
2022-08-31 11:57:24 +00:00
..
Platforms cmake: fix original MinGW builds 2022-08-31 11:57:24 +00:00
cmake_uninstall.cmake.in copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
CMakeConfigurableFile.in copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
curl-config.cmake.in copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
CurlSymbolHiding.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
CurlTests.c cmake: add detection of threadsafe feature 2022-08-26 21:09:32 +02:00
FindBearSSL.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindBrotli.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindCARES.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindGSS.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindLibPSL.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindLibSSH2.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindMbedTLS.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindMSH3.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindNGHTTP2.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindNGHTTP3.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindNGTCP2.cmake cmake: support ngtcp2 boringssl backend 2022-07-05 10:09:40 +02:00
FindNSS.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindQUICHE.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindWolfSSL.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
FindZstd.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
Macros.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
OtherTests.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00
Utilities.cmake copyright: make repository REUSE compliant 2022-06-13 09:13:00 +02:00