diff options
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index eedc6ab..29708d9 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -667,10 +667,23 @@ cmMakefileTargetGenerator { std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE"; const char *iwyu = this->GeneratorTarget->GetProperty(iwyu_prop); - if (iwyu && *iwyu) + std::string const tidy_prop = lang + "_CLANG_TIDY"; + const char *tidy = this->GeneratorTarget->GetProperty(tidy_prop); + if ((iwyu && *iwyu) || (tidy && *tidy)) { - std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu --iwyu="; - run_iwyu += this->LocalGenerator->EscapeForShell(iwyu); + std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_iwyu"; + if (iwyu && *iwyu) + { + run_iwyu += " --iwyu="; + run_iwyu += this->LocalGenerator->EscapeForShell(iwyu); + } + if (tidy && *tidy) + { + run_iwyu += " --tidy="; + run_iwyu += this->LocalGenerator->EscapeForShell(tidy); + run_iwyu += " --source="; + run_iwyu += sourceFile; + } run_iwyu += " -- "; compileCommands.front().insert(0, run_iwyu); } |