# C++ static code analysis tools

**URL:** <https://discuss.gradle.org/t/c-static-code-analysis-tools/11379>\
**Category:** Help/Discuss\
**Created:** [August 28, 2015, 9:23am UTC](https://discuss.gradle.org/t/c-static-code-analysis-tools/11379 "2015-08-28T09:23:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![questor](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@questor](https://discuss.gradle.org/u/questor)\
**Post date:** [August 28, 2015, 9:23am UTC](https://discuss.gradle.org/t/c-static-code-analysis-tools/11379/1 "2015-08-28T09:23:03Z")

</div>

Hi!

what’s the best way to include static code analysis into an c++ based project? Some tools can be called instead of the c++ compiler (but without a clean build not all c-files will be send to the analyzer) and some need only the cpp file names the project consist of…  
does chaning the compiler executable for a specific toolchain trigger a rebuild? should I add logic as a function to get all source files and send them through an analyzer? (but then I don’t get all defines right if they are dynamically set during the build pre processing)
