与Make Command的汇编的指标
我使用cmake生成一些将使用Linux上G ++编译多个目标的makefiles。 我想创建一些有关汇编的指标,例如:
- 构建每个目标
- G ++警告和错误
所需的时间,我迄今为止提出的唯一解决方案是重定向整个文件的制造和解析,但这似乎真的很重。我无法使用G ++标志-fdiagnostics-format = JSON
功能,因为我无法升级到GCC-9。
有什么建议吗?非常感谢
I use CMake to generate some makefiles that will compile multiple targets using G++ on Linux.
I would like to create some metrics about the compilation such as :
- Time needed to build each target
- G++ warnings and errors
The only solution I came up with so far is to redirect the output of make and parse the whole file but this seems really heavy. I cannot use the G++ flag -fdiagnostics-format=json
feature since I cannot upgrade to GCC-9.
Any suggestions? Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就时间而言,请考虑使用 ninja 而不是制造。当您构建时,它会产生一个名为
$ {CMAKE_BINARY_DIR}/。NINJA_LOG
的文件,该文件可以转换为与Chrome的兼容的格式,以:跟踪
flame图形格式。这里有一个脚本可以在这里这样做: https://github.com/nico/nico/nico/ninjatracing
As far as timing is concerned, consider using Ninja instead of Make. When you build it produces a file called
${CMAKE_BINARY_DIR}/.ninja_log
that can be converted to a format compatible with Chrome'sabout:tracing
flame graph format.There's a script for doing that here: https://github.com/nico/ninjatracing
您可以做的事情是将编译器设置为包装G ++功能并添加一些(类似于某些CCACHE集成的工作方式)的程序或外壳脚本:
Something you could do is set the compiler to be a program or shell script that wraps the G++ functionality and add some (similar to how some ccache integrations work):