mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
cmListCommand: check list(FILTER) operation before the list
A future commit will make the not-a-list case a success, but invalid operations should still be diagnosed in that case.
This commit is contained in:
@@ -1289,14 +1289,6 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& listName = args[1];
|
|
||||||
// expand the variable
|
|
||||||
std::vector<std::string> varArgsExpanded;
|
|
||||||
if (!this->GetList(varArgsExpanded, listName)) {
|
|
||||||
this->SetError("sub-command FILTER requires list to be present.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& op = args[2];
|
const std::string& op = args[2];
|
||||||
bool includeMatches;
|
bool includeMatches;
|
||||||
if (op == "INCLUDE") {
|
if (op == "INCLUDE") {
|
||||||
@@ -1308,6 +1300,14 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string& listName = args[1];
|
||||||
|
// expand the variable
|
||||||
|
std::vector<std::string> varArgsExpanded;
|
||||||
|
if (!this->GetList(varArgsExpanded, listName)) {
|
||||||
|
this->SetError("sub-command FILTER requires list to be present.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& mode = args[3];
|
const std::string& mode = args[3];
|
||||||
if (mode == "REGEX") {
|
if (mode == "REGEX") {
|
||||||
if (args.size() != 5) {
|
if (args.size() != 5) {
|
||||||
|
|||||||
Reference in New Issue
Block a user