Experimental `import std` support not enabled when detecting toolchain clang-22.1?

bash-5.3$ ~/.local/bin/cmake --workflow llvm-release --fresh
Executing workflow step 1 of 3: configure preset "llvm-release"

-- CXXFLAGS=-stdlib=libc++
'brew' '--prefix' 'llvm'
-- LLVM_DIR=/usr/local/Cellar/llvm/22.1.0
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/llvm/22.1.0/lib/c++/libc++.modules.json
-- The CXX compiler identification is Clang 22.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Cellar/llvm/22.1.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=/usr/local/Cellar/llvm/22.1.0/include/c++/v1;/usr/local/Cellar/llvm/22.1.0/lib/clang/22/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/llvm/22.1.0/lib/c++/libc++.modules.json
-- BEMAN_USE_MODULES=TRUE
-- BEMAN_USE_STD_MODULE=TRUE
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- CMAKE_CXX_MODULE_STD=ON
-- BEMAN_HAS_IMPORT_STD=ON
-- CMAKE_CXX_SCAN_FOR_MODULES=ON
Compiler is: Clang version: 22.1.0
cmake is: 4.3.0-rc1-gd072d3b modules scan: ON
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
Tests to be built: scope_success;scope_exit;scope_fail;unique_resource;unique_resource_2;module
Examples to be built: scope_example;unique_resource;unique_resource-file;scope-module
-- Configuring done (17.5s)
CMake Error in CMakeLists.txt:
  The "CXX_MODULE_STD" property on target "beman.scope" requires toolchain
  support, but it was not provided.  Reason:

    Experimental `import std` support not enabled when detecting toolchain; it must be set before `CXX` is enabled (usually a `project()` call)


CMake Generate step failed.  Build files cannot be regenerated correctly.
bash-5.3$ 

Note found

This support is provided only when experimental support for import std has been enabled by theCMAKE_EXPERIMENTAL_CXX_IMPORT_STD gate.

I thought the experimental is over?

The experimental gate was put back in place because we found that toolchains do not reliably ship the initialization symbol (see your issue here for an example). Without this, there are issues with providing it. We’re working with toolchains to determine the next steps.

2 Likes