cmake对c++20 module的支持


相关链接

知乎 孙孟越 介绍比较详细了,还介绍了 C++ 之父介绍了 modules 的发展进程.

github modules-reportmodules-report

cmake target_sources

target_sources CMake 2022 C++ Modules and More - Bill Hoffman - CppNow 2022 22年7月就分享了如何支持module,一直到10月份才出来。

target_sources

简单示例,上边youtube中的。

图 1  cmake target_source

demo

import CMake; C++20 Modules (kitware.com)

上边是cmake官方给出的例子,比较简单。

我在vs2022 preview 17.6、cmake3.26下测试,模块分区(module internal partition)还不被支持。 目前来说(2023.4)c++20的构建系统还不是很完善。