[libcxx-commits] [libcxxabi] da10444 - [libc++] Allow building without threads in standalone builds

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 15 05:45:12 PDT 2020


Author: Louis Dionne
Date: 2020-09-15T08:44:48-04:00
New Revision: da104444fafbc8f657f06c2188ab2e8284563e3d

URL: https://github.com/llvm/llvm-project/commit/da104444fafbc8f657f06c2188ab2e8284563e3d
DIFF: https://github.com/llvm/llvm-project/commit/da104444fafbc8f657f06c2188ab2e8284563e3d.diff

LOG: [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

Added: 
    

Modified: 
    libcxxabi/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 96a1c625222a..10ac112c90d9 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -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)


        


More information about the libcxx-commits mailing list