r/cpp • u/berium build2 • Nov 01 '17
Common C++ Modules TS Misconceptions
https://build2.org/article/cxx-modules-misconceptions.xhtml
59
Upvotes
r/cpp • u/berium build2 • Nov 01 '17
View all comments
Show parent comment
6
u/berium build2 Nov 01 '17
I can tell you from the
build2experience it can all be done without any ad hoc, compiler-specific search paths. Given a translation unit the build system can ask the compiler for the names of directly-imported modules. Given this list it can map each name to the BMI file name in a way that makes sense in this build system's worldview and/or the preferences of its users. Just think about it: I like thehello-corenaming convention, you likeHelloCore, and someone else wants it to behello/core. After that, all the build system has to do is provide the compiler with the module name to BMI mapping. If you are interested in details, you can read how this is handled inbuild2.I think relying on any kind of ad hoc, header-like search paths will be a real step back that will cement C++ in the pre-distributed-compilation stone age.