/ curl Public
cmake: do not force Windows target versions #9046
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
The goal of this patch is to avoid CMake forcing specific Windows
versions and rely on toolchain defaults or manual selection instead.
This gives back control to the user. This also brings CMake closer to
how autotools and
Makefile.m32behaves in this regard.
CMake had a setting
ON, which did
nothing else than fixing the Windows build target to Vista. This also
happened when the toolchain did not have Vista support (e.g. original
MinGW), breaking such builds.
In other environments it did not make a user-facing difference,
because libcurl has its own
pton()implementation, so it works well
with or without Vista's
This patch drops this setting.
inet_pton()is now used whenever
building for Vista or newer, either when requested manually or by
default with modern toolchains (e.g. mingw-w64). Older envs will fall
back to curl's
Ref: windows: improve random source #9027 (comment)
Ref: lib/easy_lock.h: include synchapi.h on Windows #8997 (comment)
When the user did no select a Windows target version manually, stop
explicitly targeting Windows XP, and instead use the toolchain default.
This may pose an issue with old toolchains defaulting to pre-XP
targets. In such case you must manually target Windows XP via: