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/GabrielDosReis Jun 02 '26

The magic that MSVC does is unfortunate, but I under "ship something out the door" pressure I've seen a lot of, I fear for the long-term fallout of it.

The dllimport/dllexport translation isn't magic though if you think about it... and I have never hidden exactly how it works.

As for the BMI compatibility itself, more should be done, but the idea has always met intense resistance for various reasons. It is unfortunate. However, I am optimistic that eventually, the inescapable practical necessity will prevail.

1

u/mathstuf cmake dev Jun 02 '26

How does it handle a module split across multiple libraries and libraries with multiple modules in it?

1

u/GabrielDosReis Jun 02 '26

the dllimport/dllexport decision is based on whether the module is imported for use (which is indicated by an explicit import) and if the symbol is made available for odr-use (as opposed to definition).