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
1
u/not_a_novel_account cmake dev Jun 07 '26 edited Jun 08 '26
The same way we do now, this hasn't changed at all with modules.
This is exactly how it works, yes. Interface units replace headers, but as an ecosystem artifact they are the same. They ship as source code and are interpreted by consumers, possibly accompanied by a pre-built BMI as an optimization for compatible consumers.
This is how it works now. The question is what flags do they get. This is the nature of the final example:
If you try to use the same flags for everything, that will work, but you will expose the private header to consumers which is unintended. Maybe this is an acceptable compromise for you, but in fact is a third choice in the matrix, neither Xmake nor CMake think it's correct to do so here.
Software which uses your build system can be built, packaged, and shipped by a Debian maintainer. If you had insisted your build system would only consume libraries built with the same C++ version as the project, that would not be able to be used by Debian. They use project dependencies built under all sorts of different standards and flag lines, not one universal standard.