Код: Выделить всё
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)
< /code>
Но Cmake, кажется, никогда не включает флаг: < /p>
Experimental `import std` support not enabled when detecting toolchain; it must be set before `CXX` is enabled (usually a `project()` call)
Подробнее здесь: https://stackoverflow.com/questions/796 ... n-it-is-ca
Мобильная версия