diff options
author | Brad King <brad.king@kitware.com> | 2017-08-30 14:54:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-30 14:55:24 (GMT) |
commit | 82d9bbf2b713de4db2810c202db26c4b18a22e9c (patch) | |
tree | 38595a29e14f4b0ee2129e36b33a5865c035cde7 /Source/cmMakefileTargetGenerator.cxx | |
parent | 2df8dbcdf26f6301d4c23e0988d6e4ebe3b7cae5 (diff) | |
parent | 311b7b1a7095ec460fab950a6767571eb3b9652c (diff) | |
download | CMake-82d9bbf2b713de4db2810c202db26c4b18a22e9c.zip CMake-82d9bbf2b713de4db2810c202db26c4b18a22e9c.tar.gz CMake-82d9bbf2b713de4db2810c202db26c4b18a22e9c.tar.bz2 |
Merge topic 'add-cppcheck'
311b7b1a Add properties to run cppcheck along with the compiler
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1147
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b9bcdef..c1cf103 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -633,7 +633,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( const char* tidy = this->GeneratorTarget->GetProperty(tidy_prop); std::string const cpplint_prop = lang + "_CPPLINT"; const char* cpplint = this->GeneratorTarget->GetProperty(cpplint_prop); - if ((iwyu && *iwyu) || (tidy && *tidy) || (cpplint && *cpplint)) { + std::string const cppcheck_prop = lang + "_CPPCHECK"; + const char* cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop); + if ((iwyu && *iwyu) || (tidy && *tidy) || (cpplint && *cpplint) || + (cppcheck && *cppcheck)) { std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu"; if (iwyu && *iwyu) { run_iwyu += " --iwyu="; @@ -647,7 +650,12 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( run_iwyu += " --cpplint="; run_iwyu += this->LocalGenerator->EscapeForShell(cpplint); } - if ((tidy && *tidy) || (cpplint && *cpplint)) { + if (cppcheck && *cppcheck) { + run_iwyu += " --cppcheck="; + run_iwyu += this->LocalGenerator->EscapeForShell(cppcheck); + } + if ((tidy && *tidy) || (cpplint && *cpplint) || + (cppcheck && *cppcheck)) { run_iwyu += " --source="; run_iwyu += sourceFile; } |