[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
This commit is contained in:
Louis Dionne 2020-09-15 08:43:08 -04:00
parent 50d2a5d4c7
commit da104444fa
1 changed files with 1 additions and 0 deletions

View File

@ -352,6 +352,7 @@ if (NOT LIBCXXABI_ENABLE_THREADS)
" is also set to ON.")
endif()
add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
add_definitions(-D_LIBCPP_HAS_NO_THREADS)
endif()
if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)