Skip to content

Commit

Permalink
[libc++][C++20 modules] Tests no except build.
Browse files Browse the repository at this point in the history
Depends on D158661

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158862
  • Loading branch information
mordante committed Sep 5, 2023
1 parent 98c6c98 commit 6f8b177
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions libcxx/cmake/caches/Generic-no-exceptions.cmake
Original file line number Diff line number Diff line change
@@ -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 "")
6 changes: 6 additions & 0 deletions libcxx/docs/Modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ What works
* ``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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions libcxx/modules/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ macro(compile_define_if condition def)
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
Expand All @@ -42,6 +38,10 @@ target_sources(std
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++
Expand Down
7 changes: 5 additions & 2 deletions libcxx/utils/ci/buildkite-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,11 @@ steps:
- "**/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"
Expand Down

0 comments on commit 6f8b177

Please sign in to comment.