curl/CMake
Viktor Szakats 2c4bfefe91
build: stop detecting sched_yield() on Windows
On Windows a successful `sched_yield()` detection requires mingw-w64
built with POSIX threads (not Win32 threads) and GCC (not llvm/clang).
(linking to `winpthread` via custom options may also work.)

In CMake builds, it was pre-cached as unavailable before this patch.

When detected (via autotools), it got only used for Windows XP or older
targets combined with a non-GCC, non-clang compiler that doesn't support
`__builtin_ia32_pause()`, or with the Intel C compiler. According to
`lib/easy_lock.h`.

mingw-w64 only supports GCC and clang, leaving a very narrow chance when
`shed_yield()` gets called on Windows. Even then, `sched_yield()` is
implemented in `winpthread` as `Sleep(0)`, which may or not be a useful.
It's also trivial to implement locally if it is, and such rare build
combination is also deemed useful.

Thus, this patch marks `sched_yields()` permanently unavailable on the
Windows platform also with autotools, and instead of pre-caching, skip
this feature check with CMake.

This syncs `HAVE_SCHED_YIELDS` between builds methods on Windows.

Follow-up to 9b517c8b69 #11973
Follow-up to 23af112f55 #8680

Closes #16037
2025-01-17 23:31:58 +01:00
..
cmake_uninstall.cmake.in cmake: more small tidy-ups and fixes 2024-08-08 13:48:28 +02:00
CMakeConfigurableFile.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl-config.cmake.in android: add CI jobs, buildinfo, cmake docs, disable CURL_USE_PKGCONFIG by default 2025-01-17 00:44:11 +01:00
CurlSymbolHiding.cmake Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
CurlTests.c cmake: detect mingw-w64 version, pre-fill HAVE_STRTOK_R 2025-01-17 23:31:57 +01:00
FindBearSSL.cmake cmake: document -D and env build options 2024-10-24 23:06:40 +02:00
FindBrotli.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindCares.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindGSS.cmake cmake: drop redundant opening/closing .* from MATCH expressions 2024-12-20 11:38:59 +01:00
FindLDAP.cmake cmake/FindLDAP: avoid framework locations for libs too (Apple) 2025-01-02 12:55:50 +01:00
FindLibgsasl.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibidn2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibpsl.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibrtmp.cmake cmake: add librtmp Find module 2024-12-27 12:52:23 +01:00
FindLibssh2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibssh.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindLibuv.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindMbedTLS.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindMSH3.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNettle.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGHTTP2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGHTTP3.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindNGTCP2.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindQuiche.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
FindRustls.cmake cmake: make system libraries dl, m, pthread customizable 2025-01-02 12:55:50 +01:00
FindWolfSSH.cmake cmake: clear package version after pkg-config detection 2024-10-25 15:04:35 +02:00
FindWolfSSL.cmake cmake: make system libraries dl, m, pthread customizable 2025-01-02 12:55:50 +01:00
FindZstd.cmake cmake: move pkg-config names to Find modules 2024-12-26 12:59:59 +01:00
Macros.cmake cmake: extend zlib's AUTO option to brotli, zstd and enable if found 2024-12-17 04:06:45 +01:00
OtherTests.cmake Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
PickyWarnings.cmake build: fix -Wtrampolines picky warning for gcc 4.x versions 2025-01-10 18:21:10 +01:00
Utilities.cmake cmake: tidy up local variable names 2024-12-28 12:29:59 +01:00
win32-cache.cmake build: stop detecting sched_yield() on Windows 2025-01-17 23:31:58 +01:00