r/cpp • u/not_a_novel_account cmake dev • Jun 01 '26
BMI Compatibility: Testing Build System C++ Modules Support
https://blog.vito.nyc/posts/bmi-compatibility/
68
Upvotes
r/cpp • u/not_a_novel_account cmake dev • Jun 01 '26
View all comments
Show parent comment
3
u/tartaruga232 MSVC user, r/cpp_modules Jun 02 '26
Indeed.
We're now combining a lot of module interface units and implementation units into a single module unit each, which has both the interface and the implementation in the same file, separated by a private module fragment declaration (
"module : private;"/ example: https://github.com/cadifra/cadifra/blob/main/code/WinUtil/Dispatcher.ixx). The advantage of doing that is, that the compiler needs to read only one file and it produces the BMI and the obj in one go.Doing that is sometimes not possible if you get import cycles or the dependencies are too heavy. Then you have to use the classical interface / implementation file split.
Small modules support this kind of combined interface / implementation style pretty well.