How to disable code analysis in MSBuild target ClCompile?

跟風遠走 提交于 2019-12-07 15:05:04

问题


When I build my projects via MSBuilds scripts, I obtain the following message during the work of ClCompile target: Running Code Analysis for C/C++…

Output of MSBuild looks like:

ClCompile:
  ....
  Source1.cpp
  Source2.cpp
  Running Code Analysis for C/C++…

After changing <RunCodeAnalysis> property in build scripts to false:

<PropertyGroup>
    <RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>

this just disabled running RunCodeAnalysis MSBuild target, but it does not affect running code analysis in ClCompile target - it seems it should be disabled somewhere else.

How can I disable code analysis during execution of ClCompile target?


回答1:


<EnablePREfast> should be set up to false.

I have used the following code:

<PropertyGroup>
    <EnablePREfast>false</EnablePREfast>
</PropertyGroup>

More info at CL Task




回答2:


In Project Property page, goto Code Analysis (the last one on left tree). There you can disable Code analysis feature. In VC10+, you just need to de-select second check box. In earlier versions, you set third property to No.



来源:https://stackoverflow.com/questions/9438987/how-to-disable-code-analysis-in-msbuild-target-clcompile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!