Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: do not force Windows target versions
The goal of this patch is to avoid CMake forcing specific Windows versions and rely on toolchain defaults instead. This gives back control to the user. Curl is able to adapt to what's available. This also brings CMake closer to how autotools and `Makefile.m32` behaves in this regard. - CMake had a setting `ENABLE_INET_PTON` defaulting to `ON`, which did nothing else than fixing the Windows build target to Vista. This was done even when the toolchain did not have Vista support (e.g. original MinGW), breaking such builds. On other systems it did not make a user-facing difference, because libcurl has its own pton() implementation, so it works equally well with or without Vista's inet_pton(). This patch drops this setting. inet_pton() is now used whenever building for Vista or newer, either when requested manually via or by default with modern toolchains (e.g. mingw-w64). Older envs will fall back to curl's pton(). Ref: #9027 (comment) Ref: #8997 (comment) - Deprecate `CURL_TARGET_WINDOWS_VERSION` in favour of the universal way of setting the Windows target version: `-D_WIN32_WINNT=0xnnnn`. This can be passed to CMake like this: `-DCMAKE_C_FLAGS=-D_WIN32_WINNT=0xnnnn` `CURL_TARGET_WINDOWS_VERSION` was introduced in early 2021, so it is also an option to delete it, if we have an agreement on that. - When the user did no select a Windows target version manually, stop explicitly targeting Windows XP, and instead use whatever the toolchain default is. This may pose an issue with old toolchains defaulting to pre-XP targets. In such case you must manually target Windows XP via: `-DCMAKE_C_FLAGS=-D_WIN32_WINNT=0x0501` Closes #xxxx
- Loading branch information