mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
cmMakefile: Use find_if instead of manual loop
...in the `cmMakefile::ValidateCustomCommand()` as it was a warning issued by `clang-tidy`.
This commit is contained in:
@@ -1131,15 +1131,17 @@ bool cmMakefile::ValidateCustomCommand(
|
||||
const cmCustomCommandLines& commandLines) const
|
||||
{
|
||||
// TODO: More strict?
|
||||
for (cmCustomCommandLine const& cl : commandLines) {
|
||||
if (!cl.empty() && !cl[0].empty() && cl[0][0] == '"') {
|
||||
this->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("COMMAND may not contain literal quotes:\n ", cl[0], '\n'));
|
||||
return false;
|
||||
}
|
||||
const auto it =
|
||||
std::find_if(commandLines.begin(), commandLines.end(),
|
||||
[](const cmCustomCommandLine& cl) {
|
||||
return !cl.empty() && !cl[0].empty() && cl[0][0] == '"';
|
||||
});
|
||||
if (it != commandLines.end()) {
|
||||
this->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("COMMAND may not contain literal quotes:\n ", (*it)[0], '\n'));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user