I'm trying to profile the build time of my project so I can see what's taking the most time. This seems like it should be easy... if I had every clang
command listed in a file I could time each one of them and sort by time to find the compilations that take the longest, then I could go in and see which of those compilation units are surprising and try to figure out why they are so slow.
Googling gets me nowhere on this. Clearly this is possible and would be useful.
So, either:
- What's the option to basically do this?
or
- How do I get CMake/ninja to dump out the list of all
clang
commands it wants to run? - Alternately, maybe the way to do it is to write a script that logs the command and time it took and use that as a
CXX_COMPILER_LAUNCHER
?