cmake:编译统计 [英] cmake: compilation statistics

查看:138
本文介绍了cmake:编译统计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要弄清楚需要重组哪些翻译单元以改善编译时间,如何利用cmake掌握翻译单元的编译时间?

I need to figure out which translation units need to be restructured to improve compile times, How do I get hold of the compilation time, using cmake, for my translation units ?

推荐答案

我希望将编译器(和/或链接器)替换为'time original-cmd'。使用普通的 make,我会说:

I would expect to replace the compiler (and/or linker) with 'time original-cmd'. Using plain 'make', I'd say:

make CC="time gcc"

时间程序将运行命令并报告所花费的时间。等效的机制将与 cmake一起使用。如果需要捕获命令和时间,则可以编写类似于时间的命令(shell脚本可以执行),以所需的方式记录所需的数据。

The 'time' program would run the command and report on the time it took. The equivalent mechanism would work with 'cmake'. If you need to capture the command as well as the time, then you can write your own command analogous to time (a shell script would do) that records the data you want in the way you want.

这篇关于cmake:编译统计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆