[libcxx-commits] [PATCH] D98021: [libcxxabi] Add LIBCXXABI_HAS_WIN32_THREAD_API build option

Markus Böck via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 5 06:31:14 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG05b3716ddbd5: [libcxxabi] Add LIBCXXABI_HAS_WIN32_THREAD_API build option (authored by zero9178).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98021/new/

https://reviews.llvm.org/D98021

Files:
  libcxxabi/CMakeLists.txt


Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -89,6 +89,7 @@
 option(LIBCXXABI_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
 option(LIBCXXABI_ENABLE_THREADS "Build with threads enabled" ON)
 option(LIBCXXABI_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF)
+option(LIBCXXABI_HAS_WIN32_THREAD_API "Ignore auto-detection and force use of win32 thread API" OFF)
 option(LIBCXXABI_HAS_EXTERNAL_THREAD_API
   "Build libc++abi with an externalized threading API.
   This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON." OFF)
@@ -374,6 +375,11 @@
                         " be set to ON when LIBCXXABI_ENABLE_THREADS"
                         " is also set to ON.")
   endif()
+  if (LIBCXXABI_HAS_WIN32_THREAD_API)
+    message(FATAL_ERROR "LIBCXXABI_HAS_WIN32_THREAD_API can only"
+                        " be set to ON when LIBCXXABI_ENABLE_THREADS"
+                        " is also set to ON.")
+  endif()
   if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
     message(FATAL_ERROR "LIBCXXABI_HAS_EXTERNAL_THREAD_API can only"
                         " be set to ON when LIBCXXABI_ENABLE_THREADS"
@@ -394,6 +400,11 @@
                         " and LIBCXXABI_HAS_PTHREAD_API cannot be both"
                         " set to ON at the same time.")
   endif()
+  if (LIBCXXABI_HAS_WIN32_THREAD_API)
+    message(FATAL_ERROR "The options LIBCXXABI_HAS_EXTERNAL_THREAD_API"
+                        " and LIBCXXABI_HAS_WIN32_THREAD_API cannot be both"
+                        " set to ON at the same time.")
+  endif()
   if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
     message(FATAL_ERROR "The options LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY"
                         " and LIBCXXABI_HAS_EXTERNAL_THREAD_API cannot be both"
@@ -401,6 +412,14 @@
   endif()
 endif()
 
+if (LIBCXXABI_HAS_PTHREAD_API)
+  if (LIBCXXABI_HAS_WIN32_THREAD_API)
+    message(FATAL_ERROR "The options LIBCXXABI_HAS_PTHREAD_API"
+            "and LIBCXXABI_HAS_WIN32_THREAD_API cannot be both"
+            "set to ON at the same time.")
+  endif()
+endif()
+
 if (LLVM_ENABLE_MODULES)
   # Ignore that the rest of the modules flags are now unused.
   add_compile_flags_if_supported(-Wno-unused-command-line-argument)
@@ -428,6 +447,10 @@
   add_definitions(-D_LIBCPP_HAS_THREAD_API_PTHREAD)
 endif()
 
+if (LIBCXXABI_HAS_WIN32_THREAD_API)
+  add_definitions(-D_LIBCPP_HAS_THREAD_API_WIN32)
+endif()
+
 if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
   add_definitions(-D_LIBCPP_HAS_THREAD_API_EXTERNAL)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98021.328507.patch
Type: text/x-patch
Size: 2639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210305/196252f3/attachment.bin>


More information about the libcxx-commits mailing list