Issue
I have a large C++ project of hundreds of files with a CMake build system. How can I use GCC's -ftime-report
option but get a single summary for the full build?
I am looking to improve build times and this would be helpful to know where to focus the effort.
Solution
You would need to implement that manually by parsing the output somehow.
A good way to get a higher level overview is to use Ninja and parse the .ninja_log file: https://github.com/ninja-build/ninja/issues/1080#issuecomment-255436851
Also see https://github.com/nico/ninjatracing. Chromium uses tools like that to keep track of build times.
Update:
-ftime-report
is simply not suitable for this task as it's meant for compiler devs. Use clang and https://github.com/aras-p/ClangBuildAnalyzer for this.
gcc is far from supporting -ftime-trace
: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92396
Answered By - Trass3r