Thank you very much, did not find this in Github in my first search. And thought this might not be realy a zig issue, so I wanted to ask first in the community.
Currently if you want to use C++ modules, you pretty much have to use CMake with a subset of buildsystems (e.g. it will never work with Make). Currently only ninja (single and multi-config, version 1.11+) and VS Studio 17 2022 (and up) are supported. And even then Header units aren’t supported (e.g. import "myheader.h";). And all of that while keeping in mind that CMake is pretty much spearheading the implementation together with the compiler implementors.
It will take a LONG time until C++ modules are properly supported everywhere (if at all) since it requires the buildsystem and compiler to work in tandem.
I have several small C++ projects that now use C++23 with modules, using clang++ 19.1.7 and cmake 3.31.6. Since this discussion is six months old and the GH issues (#15496 linked above and the newer #25110) end about three months ago, I’m quite interested in finding out the current thinking on enabling support for C++ modules. I have zero knowledge of the Zig C++ compiler implementation, but it seems to me that in order to support C++ modules, Zig would have to do something akin to what CMake implemented, i.e., scan the source files to determine inter-module dependencies (which are saved to “.ddi” files) so that it can figure out the correct compilation order.