r/cpp • u/holyblackcat • Mar 09 '26
The compilation procedure for C++20 modules
https://holyblackcat.github.io/blog/2026/03/09/compiling-modules.html
103
Upvotes
r/cpp • u/holyblackcat • Mar 09 '26
View all comments
2
u/mwasplund soup Mar 10 '26
This is well written. Concise and to the point while not missing out on the main details. I did not know about reduced BMIs for Clang, will have to look into that. A great reference for looking back to as I work on my build system. Thanks!
Handling indirect dependencies is one of the annoying aspects of handling transitive dependencies for modules. I wish a module interface would contain all of accessible exported portions of the internal partition interface units so it can be the single source of truth for a named module. For now I have to flatten the entire dependency tree and treat all BMIs as the same input so we can detect changes and rebuild when necessary.
FYI, I think you are missing an
exportin the a.cppm sample under "Kinds of module units" section 4.