[libc++] Build thread_win32.cpp only if LIBCXX_HAS_PTHREAD_API is not set
authorColin Finck <colin@reactos.org>
Tue, 16 Feb 2021 15:03:04 +0000 (10:03 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 16 Feb 2021 15:03:42 +0000 (10:03 -0500)
commit0f5020af7f347f029b5687f7a6d3b72174995d59
tree380604ed09ed557ce0556b1188522f58d5d142c1
parentd8c7f442eaf21a5ad42a5ac101f66b69984ef065
[libc++] Build thread_win32.cpp only if LIBCXX_HAS_PTHREAD_API is not set

This allows building libc++ against winpthreads from mingw-w64 to support
operating systems older than Windows 7. The remaining libc++ code already
supports `WIN32` with `LIBCXX_HAS_PTHREAD_API`.

Note that there is also the older "pthreads-win32". However, that support
library implements `pthread_t` as a struct, which violates the libc++
assumption that `pthread_t` is always a scalar and can be compared,
ordered, and set to zero.

Differential Revision: https://reviews.llvm.org/D96339
libcxx/src/CMakeLists.txt