本文介绍了CMake:如何显示编译器的标准输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该非常简单,但是我很难弄清楚。通常,在使用 make 构建项目时,仅显示编译器的stderr。我如何配置CMake也显示编译器的标准输出?
如果需要的话,我正在使用GCC。

This should be really simple, but I am having a hard time figuring it out. Usually, when building the project with make, only the stderr of the compiler is shown. How can I configure CMake to display the stdout of the compiler also?I am using GCC, if this should matter.

推荐答案

您可以使用 make VERBOSE = 1 CMAKE_VERBOSE_MAKEFILE 变量以显示CMake正在运行的命令。

You can use make VERBOSE=1 and the CMAKE_VERBOSE_MAKEFILE variable to show commands being run by CMake.

CMake还会自动为源生成预处理目标,但是没有目标可以一次对每个源进行预处理。要预处理单个文件,请运行 make source.i ,它将出现在 CMakeFiles /< targetname> .dir / source.i 。实际路径可能会有所不同,因此,如果它不起作用,则可以检查CMake生成的 Makefile 以找到适当的目标。

CMake also automatically generates preprocess targets for sources, but there is no target to preprocess every source at once. To preprocess a single file, run make source.i, and it would appear in CMakeFiles/<targetname>.dir/source.i. Actual paths may differ, so if it doesn't work, you can check Makefile generated by CMake for the appropriate target.

这篇关于CMake:如何显示编译器的标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 12:06