I have a very simple script:
cmake_minimum_required(VERSION 4.0 FATAL_ERROR)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
set(CMAKE_CXX_MODULE_STD 1)
project(import_std LANGUAGES CXX)
add_executable(main)
target_sources(main PRIVATE main.cpp)
target_compile_features(main PRIVATE cxx_std_23 INTERFACE cxx_std_23)
But cmake seems to never actually enable the flag:
Experimental `import std` support not enabled when detecting toolchain; it must be set before `CXX` is enabled (usually a `project()` call)
Nothing really seems to let me get around this.
For context I'm using clang for compilation and lld for linking.
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")- and what exactly does that UUID refer to? We can't just guess that..cmakeexecutable. Do you actually use CMake built from the sources? E.g if you use CMake of version 4.0.0, then UUID differs: github.com/Kitware/CMake/blob/v4.0.0/Help/dev/…