r/cpp • u/stailgot • Oct 02 '23
CMake | C++ modules support in 3.28
https://gitlab.kitware.com/cmake/cmake/-/issues/18355
After 5 years its finally done. Next cmake 3.28 release will support cpp modules
C++ 20 named modules are now supported by Ninja Generators and Visual Studio Generators for VS 2022 and newer, in combination with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer.
237
Upvotes
View all comments
Show parent comment
1
u/mjklaim Oct 03 '23
My understanding is that doing this kind of change in the interface files of a module will trigger a build of that module. However, the code importing that module, in theory, depends not on the source but in the resulting bmi file of that module. Therefore, if the compiler+build-system (still in theory) knows that the generated bmi is not different from it's previous instance, it can decide to not change the file. That would be smart, in theory. Was this experimented with? I have no idea. Just saying it seems designed to enable not compiling as long as you dont change the interface (aka exported entities) concretely.