mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Linting: Fix empty evaluated genex
Update logic added by commit099934e313(Add generator expression support to static code analysis hooks, 2023-03-24, v3.27.0-rc1~261^2), and preserved by commit993dde925f(TargetGenerator: Factor out generation of code check rules, 2023-05-12, v3.27.0-rc1~84^2~2), to handle a generator expression that evaluates to the empty string. If `<LANG>_CPPCHECK`, `<LANG>_CPPLINT`, `<LANG>_CLANG_TIDY`, or `<LANG>_INCLUDE_WHAT_YOU_USE` are empty after evaluating generator expressions, do not run their lints. Fixes: #25265
This commit is contained in:
committed by
Brad King
parent
51b34a5483
commit
80df7b1745
@@ -335,10 +335,7 @@ std::string cmCommonTargetGenerator::GenerateCodeCheckRules(
|
||||
auto evaluatedProp = cmGeneratorExpression::Evaluate(
|
||||
*value, this->GeneratorTarget->GetLocalGenerator(), config,
|
||||
this->GeneratorTarget, nullptr, this->GeneratorTarget, lang);
|
||||
if (!evaluatedProp.empty()) {
|
||||
return evaluatedProp;
|
||||
}
|
||||
return *value;
|
||||
return evaluatedProp;
|
||||
};
|
||||
std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY");
|
||||
tidy = evaluateProp(tidy_prop);
|
||||
|
||||
Reference in New Issue
Block a user