r/cpp • cmake dev • Jun 01 '26

BMI Compatibility: Testing Build System C++ Modules Support

https://blog.vito.nyc/posts/bmi-compatibility/
68 Upvotes

43 comments sorted by

View all comments

Show parent comment

1

u/not_a_novel_account cmake dev Jun 02 '26

The language has no notion of BMI compatibility, it's not something mandated as part of the standard.

It's also not compiling, despite the use of the word "build". Generating BMIs is much cheaper than producing an object file, it's effectively the same as parsing the header file.

Previously, parsing a header in the context of the consuming TU was something you got trivially from plaintext inclusion, now the build system has to make it happen. The benefit is we have to do it far less often than every single TU which happens to use the interface, like with headers, only when we have incompatible contexts.

2

u/Agitated-Elk5768 Jun 02 '26

This issue is somewhat like needing to generate different versions of object files from the same source file. I choose to explicitly specify the outputs and inputs, so there is no need for scanning or compatibility considerations.