4 ms·
Granted I haven't looked too deeply into this in a while, but this article seems to imply usage of modules in a way that is fundamentally incompatible with the
by muststopmyths 8y ago
Granted I haven't looked too deeply into this in a while, but this article seems to imply usage of modules in a way that is fundamentally incompatible with the actual goals of modules.
For example,according to the clang documentation for modules [1], they are meant to obviate the necessity of #including headers of libraries you are linking to.
When you link with libraries, you expect them to be compiled already. If the library is a dependency of your current project (in Visual Studio solution parlance), then it will be recompiled if needed before your project is compiled, if your build system is set up correctly. You will also take care to point your build system to the correct version of the library you want to link to, including versions that change depending on CPP flags etc.
I don't see how modules are any different.
Please enlighten me if I'm not fully grasping the point of the article.
[1] https://clang.llvm.org/docs/Modules.html https://clang.llvm.org/docs/Modules.html
- johntb86 8y agoI think visual studio might require a library to wait for another library it depends to cookie on before compiling, but that's not necessary. In general you can compile all c++ files at the same time - the only stage that needs to wait is linking.
- muststopmyths 8y agoyes, that is really annoying behavior. I once built a tool to set up custom compilation ordering to work around this.
- comex 8y agoThe "modules" feature documented on that page is Clang-specific functionality. The article is talking about the newer Modules TS, which is currently in the standardization process, and works completely differently. However, as to your specific question, both Clang modules and the Modules TS aim to support replacing #include entirely with module imports, including within a single project.
- muststopmyths 8y agointeresting. Will have to read up on it. thanks.