The __config file is found in /usr/lib/llvm-20/include/c++/v1/ but for some reason, that directory is not incorporated in the commands.
Can anyone suggest the best/right way to encode that directory in the base CMakeLists.txt? I tried adding a simple include_directories line, but this doesn’t seem to get passed to clang-scan-deps-20
My code can be found at
Steps to reproduce this on Debian/Ubuntu would be:
$ git clone https://github.com/sebsjames/maths.git
$ git checkout dev/modules_import_std # Important to get on the right branch!
$ cd maths
$ mkdir build
$ cd build
$ CC=clang-20 CXX=clang++-20 cmake .. -GNinja -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi"
$ ninja range1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b156e06..bd461fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
# 3.28.5 for basic C++20 modules; 3.30 to give access to import std;
-cmake_minimum_required(VERSION 3.30)
+cmake_minimum_required(VERSION 3.30...4.3)
# This specific value changes as experimental support evolves. See
# `Help/dev/experimental.rst` in the CMake source corresponding to
@@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.30)
# This value is ok for cmake versions from 3.31.11 up to 4.2.3 (Seb)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
-project(maths LANGUAGES CXX)
+project(maths LANGUAGES CXX C)
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS " (This can be changed with `cmake -DCMAKE_INSTALL_PREFIX=/some/place`")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_EXTENSIONS ON)
# Tell CMake that we explicitly want `import std`. This will initialize the
# property on all targets declared after this to 1
set(CMAKE_CXX_MODULE_STD 1)
diff --git a/sm/histo b/sm/histo
index c0bfce8..6dfc805 100644
--- a/sm/histo
+++ b/sm/histo
@@ -8,6 +8,7 @@
*/
module;
+#include <stdexcept>
#include <type_traits>
#include <memory>
#include <limits>
98% tests passed, 2 tests failed out of 128
Label Time Summary:
build-failure = 253.57 sec*proc (22 tests)
Total Test time (real) = 285.49 sec
The following tests FAILED:
86 - geometry_xyz_to_latlong (Failed)
102 - polysolve_1 (Failed)
Errors while running CTest
Output from these tests are in: /Users/clausklein/Workspace/cpp/cxx23/maths/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: [code=8] CMakeFiles/test.util
cd /Users/clausklein/Workspace/cpp/cxx23/maths/build && /usr/local/bin/ctest
ninja: build stopped: subcommand failed.
make: *** [test] Error 8
bash-5.3$