21 ms·
This is a long-ago solved problem, and the solutions are only getting better. GCC has the -M family of options which are explicitly designed to feed the header
by klodolph 9y ago
This is a long-ago solved problem, and the solutions are only getting better. GCC has the -M family of options which are explicitly designed to feed the header dependencies into the build system, and these flags have been around since the dark ages. More modern systems like Bazel will sandbox the build so if you try to #include a file that's not listed as a dependency you'll just get a compiler error. If you want, you can specify the compiler itself as a dependency.
Hermetic builds are the way to go for a ton of reasons.
- deleted 9y ago[deleted]
- JdeBP 9y agoIt is a solved problem, but your compiler does not in fact implement an adequate solution with that mechanism. * https://news.ycombinator.com/item?id=15044438 https://news.ycombinator.com/item?id=15044438 * https://news.ycombinator.com/item?id=15060146 https://news.ycombinator.com/item?id=15060146