3 ms·
Fixing this is one of the killer features of the "Blaze" family of build-systems (Buck, Bazel, Pants, Please), since they do not defer the actual build executio
by adgasf 8y ago
Fixing this is one of the killer features of the "Blaze" family of build-systems (Buck, Bazel, Pants, Please), since they do not defer the actual build execution to another program (such as Make or Ninja).
Response from a CMake dev:
> Well, by the time CMake could discover -MM flags, the build has already been written and CMake (the program) is out of the picture. Linking to a CMake target is also not just "add this library to your link line" either, so a simple response file written somewhere during the build for the linker to use is not sufficient (nevermind that this file may be updated by any TU compilation rule in a library target, something build tools tend not to like too much). I guess combination configure/generate build tools can do this, but CMake is a build generator and does not execute the build at all.
https://www.reddit.com/r/cpp/comments/auyl07/are_headers_really_the_problem/ehdm36y/ https://www.reddit.com/r/cpp/comments/auyl07/are_headers_rea...
- yongjik 8y ago...Is it? Maybe blaze/bazel changed a lot in the past several years, but I remember it didn't even auto-import headers. You have to manually specify every header file in your dependency list. (To be precise, for every header you include, your dependency must include some BUILD target that contains that header.) So you don't ever get "undefined symbol"... you instead get "cannot include header"! Not sure if that's an improvement. :/
- adgasf 8y agoThe header lists are specified either as a list of directories (Bazel) or using globs (Buck). You must have been using quite an old version! Yes, it is a big improvement. The error message tells you exactly what you failed to do. If a target does not export all of its headers correctly, then fixing that fixes it for everyone consuming that target, which scales well to large code-bases. It is not a coincidence that so many companies (Google, Facebook, Amazon, Twitter, Thought Machine) have converged on this design.