summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx43
1 files changed, 38 insertions, 5 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e6f8cdd..3112acd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1067,18 +1067,51 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// Maybe insert an include-what-you-use runner.
if (!compileCommands.empty() &&
(lang == "C" || lang == "CXX" || lang == "OBJC" || lang == "OBJCXX")) {
- std::string const tidy_prop = lang + "_CLANG_TIDY";
- cmValue tidy = this->GeneratorTarget->GetProperty(tidy_prop);
+ cmValue tidy = nullptr;
cmValue iwyu = nullptr;
cmValue cpplint = nullptr;
cmValue cppcheck = nullptr;
+ std::string evaluatedTIDY;
+ std::string evaluatedIWYU;
+ std::string evaluatedCPPlint;
+ std::string evaluatedCPPcheck;
+
+ std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY");
+ tidy = this->GeneratorTarget->GetProperty(tidy_prop);
+ evaluatedTIDY = cmGeneratorExpression::Evaluate(
+ *tidy, this->LocalGenerator, config, this->GeneratorTarget, nullptr,
+ this->GeneratorTarget, lang);
+ if (!evaluatedTIDY.empty()) {
+ tidy = cmValue(&evaluatedTIDY);
+ }
+
if (lang == "C" || lang == "CXX") {
- std::string const iwyu_prop = lang + "_INCLUDE_WHAT_YOU_USE";
+ std::string const iwyu_prop = cmStrCat(lang, "_INCLUDE_WHAT_YOU_USE");
iwyu = this->GeneratorTarget->GetProperty(iwyu_prop);
- std::string const cpplint_prop = lang + "_CPPLINT";
+ evaluatedIWYU = cmGeneratorExpression::Evaluate(
+ *iwyu, this->LocalGenerator, config, this->GeneratorTarget, nullptr,
+ this->GeneratorTarget, lang);
+ if (!evaluatedIWYU.empty()) {
+ iwyu = cmValue(&evaluatedIWYU);
+ }
+
+ std::string const cpplint_prop = cmStrCat(lang, "_CPPLINT");
cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
- std::string const cppcheck_prop = lang + "_CPPCHECK";
+ evaluatedCPPlint = cmGeneratorExpression::Evaluate(
+ *cpplint, this->LocalGenerator, config, this->GeneratorTarget,
+ nullptr, this->GeneratorTarget, lang);
+ if (!evaluatedCPPlint.empty()) {
+ cpplint = cmValue(&evaluatedCPPlint);
+ }
+
+ std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
+ evaluatedCPPcheck = cmGeneratorExpression::Evaluate(
+ *cppcheck, this->LocalGenerator, config, this->GeneratorTarget,
+ nullptr, this->GeneratorTarget, lang);
+ if (!evaluatedCPPcheck.empty()) {
+ cppcheck = cmValue(&evaluatedCPPcheck);
+ }
}
if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
cmNonempty(cppcheck)) {