sergtk
sergtk

Reputation: 10974

How to disable code analysis in MSBuild target ClCompile?

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?

Upvotes: 3

Views: 2914

Answers (2)

sergtk
sergtk

Reputation: 10974

<EnablePREfast> should be set up to false.

I have used the following code:

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

More info at CL Task

Upvotes: 2

Ajay
Ajay

Reputation: 18411

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.

Upvotes: 1

Related Questions