[libc++] Allow building without threads in standalone builds
authorLouis Dionne <ldionne@apple.com>
Tue, 15 Sep 2020 12:43:08 +0000 (08:43 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 15 Sep 2020 12:44:48 +0000 (08:44 -0400)
commitda104444fafbc8f657f06c2188ab2e8284563e3d
tree4c9b1e87a6e1653922e7a82979e90f36b7a500c2
parent50d2a5d4c747855dc86a8b66a4a228abb66ca08e
[libc++] Allow building without threads in standalone builds

Setting _LIBCPP_HAS_NO_THREADS is needed when building libcxxabi without
threads in standalone mode. This is useful when target WASM. Otherwise,
you get an error like "No thread API" when building libcxxabi.

It would be better to link against a properly-configured libc++ headers
CMake target when building libc++abi instead, but we don't generate such
targets yet.

Thanks to Matthew Bauer for the patch.

Differential Revision: https://reviews.llvm.org/D60743
libcxxabi/CMakeLists.txt