That is the file that import foo;
ends up reading for MSVC. You want this to import it. The object file is compiled with the original target and ships in the associated library. The consuming project also needs to create a .ifc
file for the module in order to import it. Shipping BMI files is not portable because one made with, say, -std=c++20
is not compatible with consuming code that uses -std=c++23
(maybe this particular flag is fine with MSVC, but it is not true in general).
Use FILE_SET
to store your module files and let the above MR make it work for Visual Studio; it works for Ninja generators already.