3 ms·
Or do the modules equivalent of 'g++ -MM'. Or is there some reason we wouldn't want that approach?
by humanrebar 8y ago
Or do the modules equivalent of 'g++ -MM'. Or is there some reason we wouldn't want that approach?
- jsnell 8y agoThat's the problem: you can't do that. Having the compiler produce header dependency information is possible, since the dependencies are just an optimization. If there's no dependency information available, you can just compile all of the files in an arbitrary order, and you get both the object file and a dep file. And then on further runs you use the old dep files to skip unnecessary recompilations. With modules, you can't compile the files in an arbitrary order: if A uses a module defined in B, B must be compiled first. So you need to have the dependency information available up front even for the first build. And since it needs to be available up front, it can't be generated by the compiler. It must either be produced by the build tool which becomes vastly more complicated, or manually by humans.
- coliveira 8y agoThis is not different from a situation where C++ compilation has a binary dependency on other modules. The best know situation is a static library (.a file). In this case, the project cannot be built if there is a static library missing. With modules, one cannot compile the project with missing modules, so the build system will have to provide this information.