[libcxx-commits] [PATCH] D158862: [libc++][C++20 modules] Tests no except build.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 5 09:29:40 PDT 2023


This revision was automatically updated to reflect the committed changes.
Mordante marked an inline comment as done.
Closed by commit rG6f8b17703da2: [libc++][C++20 modules] Tests no except build. (authored by Mordante).

Changed prior to commit:
  https://reviews.llvm.org/D158862?vs=553525&id=555881#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158862

Files:
  libcxx/cmake/caches/Generic-no-exceptions.cmake
  libcxx/docs/Modules.rst
  libcxx/modules/CMakeLists.txt.in
  libcxx/utils/ci/buildkite-pipeline.yml


Index: libcxx/utils/ci/buildkite-pipeline.yml
===================================================================
--- libcxx/utils/ci/buildkite-pipeline.yml
+++ libcxx/utils/ci/buildkite-pipeline.yml
@@ -705,8 +705,11 @@
         - "**/test-results.xml"
         - "**/*.abilist"
       env:
-          CC: "clang-${LLVM_HEAD_VERSION}"
-          CXX: "clang++-${LLVM_HEAD_VERSION}"
+          # Note: Modules require and absolute path for clang-scan-deps
+          # https://github.com/llvm/llvm-project/issues/61006
+          CC: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang"
+          CXX: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang++"
+          CMAKE: "/opt/bin/cmake"
           ENABLE_CLANG_TIDY: "On"
       agents:
         queue: "libcxx-builders"
Index: libcxx/modules/CMakeLists.txt.in
===================================================================
--- libcxx/modules/CMakeLists.txt.in
+++ libcxx/modules/CMakeLists.txt.in
@@ -29,10 +29,6 @@
   endif()
 endmacro()
 
-if(NOT @LIBCXX_ENABLE_EXCEPTIONS@ OR NOT @LIBCXXABI_ENABLE_EXCEPTIONS@)
-  message(FATAL_ERROR "Modules without exception support is not yet implemented.")
-endif()
-
 add_library(std)
 target_sources(std
   PUBLIC FILE_SET cxx_modules TYPE CXX_MODULES FILES
@@ -42,6 +38,10 @@
 target_compile_definitions(std PRIVATE _LIBCPP_ENABLE_EXPERIMENTAL)
 target_include_directories(std SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
 
+if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)
+  target_compile_options(std PUBLIC -fno-exceptions)
+endif()
+
 target_compile_options(std
   PUBLIC
     -nostdinc++
Index: libcxx/docs/Modules.rst
===================================================================
--- libcxx/docs/Modules.rst
+++ libcxx/docs/Modules.rst
@@ -48,9 +48,15 @@
    * ``LIBCXX_ENABLE_FILESYSTEM``
    * ``LIBCXX_ENABLE_RANDOM_DEVICE``
    * ``LIBCXX_ENABLE_UNICODE``
+   * ``LIBCXX_ENABLE_EXCEPTIONS`` [#note-no-windows]_
 
  * A C++20 based extension
 
+.. note::
+
+   .. [#note-no-windows] This configuration will probably not work on Windows
+                         due to hard-coded compilation flags.
+
 Some of the current limitations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Index: libcxx/cmake/caches/Generic-no-exceptions.cmake
===================================================================
--- libcxx/cmake/caches/Generic-no-exceptions.cmake
+++ libcxx/cmake/caches/Generic-no-exceptions.cmake
@@ -1,2 +1,3 @@
+set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
 set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
 set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158862.555881.patch
Type: text/x-patch
Size: 2613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230905/1997110c/attachment.bin>


More information about the libcxx-commits mailing list