Header-only libraries and C++20 modules

Let me know if I’m understanding this correctly:

  • The provider project installs a header-only library with an INTERFACE FILE_SET of type CXX_MODULES.
  • The consumer project finds it using find_package.
  • The consumer builds an executable linking to the provider lib, using a set of compiler flags (e.g. C++ standard level, enabled extensions) of F1. This builds the provider lib with F1. Everything OK.
  • The consumer builds a library linking to the provider lib, with flags F2. This would require building the provider lib with F2.
  • The consumer finally builds an executable linking to both the provider lib and the lib built in the previous point, with flags F3. You’d try to build the provider lib again with F3, link it together, and that would create problems.

Is this the problem that would happen here? Wouldn’t something similar happen with BMIs, too?