<div dir="ltr">I would like to create a StaticAnalysis configuration within a Visual Studio (2012) Solution/set of projects that will just run clang-cl.exe --analyze for each of the source files in each project in the solution. We have both Mac and Windows versions of our product and want a common tool and output format to add static analysis to our process.<div><br></div><div>I have created batch files based on the MSBuild command that is actually issued by Visual Studio to generate all the plist output files. The batch files and supporting files capture all the settings that need to be added and removed to invoke a successful analysis run for each source file. [Already, I have been able to clean up quite a number of potential error areas.] I have attached samples; the .bat file's extension was changed to .txt get around the email/attachment filter.</div><div><br></div><div>Is there a preferred way to integrate the clang analysis? My batch files always execute the clang command for every file. This is far too time consuming. Some of my projects have 100s of files. MSBuild already knows what has changed and needs to be re-compiled (taking into account all the dependencies), so I want to benefit from that, except checking for the plist time stamp instead of the .obj file's timestamp. I also need to avoid additional maintenance to keep the clang analysis configuration in synch as source files are added or removed from each project.<br></div><div><br></div><div>The suggested method of changing the platform toolset does not work for me. I still need to do a normal build (using Microsoft's compiler), not a complete switch to clang. And when calling clang-cl --analyze, object files are not created so the link step fails.</div><div><br></div><div>I hope this is the right forum and that I have given enough information but not included too much.</div><div><br></div><div>Thank you, Michael Mortensen</div><div><br></div></div>