问题
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