Oscar, after working for several hours to fix two intertwined bugs in the dependencies generated for LLVM, I can’t fix it fully. I can teach the scripts to detect vtable dependencies, but there are other dependencies being missed as well.
Fundamentally, the fact that we’ve had to hack around one implicit dep failure in the CMakeFiles themselves is indicative that this system isn’t working.
I’m now working on completely removing this aspect of LLVM’s CMake build, and replacing it with explicit dependencies, spelled out locally to each CMake target. I think this is the best strategy going forward for the following reasons:
- It can express dependencies we can’t auto-detect such as TableGen dependencies.
- It isn’t subject to optimization levels or toolchains.
- It is easier to update for those not using CMake: the references of note are located locally to the code being changed.
- Fundamentally, there aren’t enough libraries for these to change rapidly or often. Therefore, it seems very unlikely this will be a major maintenance burden (especially compared with the burden of maintaining explicit source file lists).
After several discussions on IRC, almost every user of CMake there agreed with this move. Doug and I both have advocated for this for a long time.
My plan is to check this in somewhat as an experiment, and explicitly tell non-CMake users to not worry about updating them. Myself and a few others who are constantly using CMake can maintain them and make sure they don’t become a huge burden to update.
Any objections, shout out now! =D I’m hoping to do this really really soon as my builds and several others are completely broken due to failures not fixed by the patch you committed.