[libcxx-commits] [libcxx] 6f8b177 - [libc++][C++20 modules] Tests no except build.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Sep 5 09:39:32 PDT 2023
Author: Mark de Wever
Date: 2023-09-05T18:29:27+02:00
New Revision: 6f8b17703da2fbabba974b82578530b152b79c26
URL: https://github.com/llvm/llvm-project/commit/6f8b17703da2fbabba974b82578530b152b79c26
DIFF: https://github.com/llvm/llvm-project/commit/6f8b17703da2fbabba974b82578530b152b79c26.diff
LOG: [libc++][C++20 modules] Tests no except build.
Depends on D158661
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D158862
Added:
Modified:
libcxx/cmake/caches/Generic-no-exceptions.cmake
libcxx/docs/Modules.rst
libcxx/modules/CMakeLists.txt.in
libcxx/utils/ci/buildkite-pipeline.yml
Removed:
################################################################################
diff --git a/libcxx/cmake/caches/Generic-no-exceptions.cmake b/libcxx/cmake/caches/Generic-no-exceptions.cmake
index f0dffef60dba082..f405f7fe9937523 100644
--- a/libcxx/cmake/caches/Generic-no-exceptions.cmake
+++ b/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 "")
diff --git a/libcxx/docs/Modules.rst b/libcxx/docs/Modules.rst
index 85c42af5a62b8db..6d730cefc9fee3a 100644
--- a/libcxx/docs/Modules.rst
+++ b/libcxx/docs/Modules.rst
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in
index 53b0d7f5f8df50c..703206e7c640579 100644
--- a/libcxx/modules/CMakeLists.txt.in
+++ b/libcxx/modules/CMakeLists.txt.in
@@ -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
@@ -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++
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index b52074e5032f049..656df8434945556 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -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"
More information about the libcxx-commits
mailing list