CMake&Visual Studio:如何获得快速,安静的命令行生成? [英] CMake & Visual Studio: How to get a quick, quiet command line build?

查看:49
本文介绍了CMake&Visual Studio:如何获得快速,安静的命令行生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个cmake项目,该项目成功完成了我想要的一切.但是我有大约100个文件,我讨厌看到生成的巨大输出,每次只需要重新编译一个文件时,每个文件30行.

I've got a cmake project that successfully does everything that I want. But I've got about 100 files, and I tire of seeing the huge output that is generated, 30 lines per file every time when I only need to recompile a single file.

要清楚,我正在编译 cmake --build.以获得此结果.

To be clear, I'm compiling cmake --build . to get this result.

我需要传递给编译器(或MSBuild)以跳过它检查未更改文件的打印的参数是什么?在Visual Studio中编译项目不会创建所有这些视觉垃圾.

What is the parameter that I need to pass to the compiler (or MSBuild) to skip the printing that it checked the unchanged files? Compiling the project inside Visual Studio doesn't create all of this visual garbage.

这是我为每个未更改的文件获得的输出:

This is the output that I'm getting for every unchanged file:

Project "C:\noscan\working\proj\build\ALL_BUILD.vcxproj" (1) is building "C:\noscan\working\proj\build\os\src\oslib.vcxproj" (54) on node 1 (default targets).
InitializeBuildStatus:
  Creating "oslib.dir\Debug\oslib.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
PreBuildEvent:
  Description: Automatic MOC for target oslib
  setlocal
  cd C:\noscan\working\tadet\build\os\src
  if %errorlevel% neq 0 goto :cmEnd
  C:
  if %errorlevel% neq 0 goto :cmEnd
  C:\cmake\bin\cmake.exe -E cmake_autogen     C:/noscan/working/tadet/build/os/src/CMakeFiles/oslib_autogen.dir Debug
  if %errorlevel% neq 0 goto :cmEnd
  :cmEnd
  endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
  :cmErrorLevel
  exit /b %1
  :cmDone
  if %errorlevel% neq 0 goto :VCEnd
  :VCEnd
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  All outputs are up-to-date.
Lib:
  All outputs are up-to-date.
  oslib.vcxproj -> C:\noscan\working\proj\build\os\src\oslib.dir\Debug\oslib.lib
FinalizeBuildStatus:
  Deleting file "oslib.dir\Debug\oslib.tlog\unsuccessfulbuild".
  Touching "oslib.dir\Debug\oslib.tlog\oslib.lastbuildstate".
Done Building Project "C:\noscan\working\proj\build\os\src\oslib.vcxproj" (default targets).

推荐答案

您可以在-之后将其他参数传递给特定于platfom的构建工具(在本例中为MSBuild)(请参见 https://cmake.org/cmake/help/v3.10/manual/cmake.1.html 了解有关-build build-tool-options 的详细说明.我在本地构建脚本 cmake --build中使用以下命令.--target安装--config调试-/nologo/verbosity:minimum/l:FileLogger,Microsoft.Build.Engine;logfile=%CWD%\MSBuild_%BUILD_NAME%_%PLATFORM%_Debug.log 几乎安静的构建.

You can pass additional arguments to the platfom specific build tool (MSBuild in this case) after the -- (see https://cmake.org/cmake/help/v3.10/manual/cmake.1.html for detailed description of --build and build-tool-options). I use the following command in my local build script cmake --build . --target INSTALL --config Debug -- /nologo /verbosity:minimal /l:FileLogger,Microsoft.Build.Engine;logfile=%CWD%\MSBuild_%BUILD_NAME%_%PLATFORM%_Debug.log for an almost quiet build.

这篇关于CMake&Visual Studio:如何获得快速,安静的命令行生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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