[libcxx-commits] [PATCH] D96339: Build thread_win32.cpp only if LIBCXX_HAS_PTHREAD_API is not set.
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 16 08:36:40 PST 2021
mstorsjo added inline comments.
Comment at: libcxx/src/CMakeLists.txt:82
+ if (NOT LIBCXX_HAS_PTHREAD_API)
+ list(APPEND LIBCXX_SOURCES
> mstorsjo wrote:
> > This is the cmake define for when pthread api is explicitly forced to be used, instead of autodetection based on platform and `__has_include(<pthread.h>)` and such - right? In that case I guess it's ok.
> > There's also been a desire (in https://reviews.llvm.org/D88124#change-1LdJXjC8YEPj) to make compilation of this file optional based on `LIBCXX_ENABLE_THREADS` - I guess it'd be nice to do that at the same time while adding conditionals here.
> Actually, it's impossible for `LIBCXX_HAS_PTHREAD_API` to be set to `ON` if `LIBCXX_ENABLE_THREADS` is `OFF`, so I think this is OK as-is.
I meant for the configuration with `LIBCXX_HAS_PTHREAD_API` disabled and `LIBCXX_ENABLE_THREADS` disabled too - in that case we still compile thread_win32.cpp (just as before this change). Not sure if there is an issue with such a config or not though - if such a patch is submitted (split out from D88124), I guess it would come with an explanation of exactly what issue it fixes.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits