diff options
author | Brad King <brad.king@kitware.com> | 2018-06-22 13:31:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-22 13:39:05 (GMT) |
commit | 142a6257294afbfdf86ec13fdb4ecf303b131f99 (patch) | |
tree | 440c9c968424de18f4f255b021208241c2864eb0 /Source | |
parent | ef5e2e8a62982ebccf4883fc7a01cdb66f8ca183 (diff) | |
download | CMake-142a6257294afbfdf86ec13fdb4ecf303b131f99.zip CMake-142a6257294afbfdf86ec13fdb4ecf303b131f99.tar.gz CMake-142a6257294afbfdf86ec13fdb4ecf303b131f99.tar.bz2 |
file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions
Refactoring in commit v3.12.0-rc1~418^2~3 (Refactor HandleGlobCommand,
2018-02-13) introduced error diagnostics for argument combinations that
were previously accepted. Restore acceptance to avoid regressing
projects that used those combinations even if they do not make sense.
Fixes: #18097
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index aae70b1..dcb79f7 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -777,7 +777,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, this->Makefile->GetCMakeInstance()->GetWorkingMode(); while (i != args.end()) { if (*i == "LIST_DIRECTORIES") { - ++i; + ++i; // skip LIST_DIRECTORIES if (i != args.end()) { if (cmSystemTools::IsOn(i->c_str())) { g.SetListDirs(true); @@ -789,27 +789,21 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, this->SetError("LIST_DIRECTORIES missing bool value."); return false; } + ++i; } else { this->SetError("LIST_DIRECTORIES missing bool value."); return false; } - ++i; - if (i == args.end()) { - this->SetError("GLOB requires a glob expression after the bool."); - return false; - } } else if (*i == "FOLLOW_SYMLINKS") { - if (!recurse) { - this->SetError("FOLLOW_SYMLINKS is not a valid parameter for GLOB."); - return false; - } - explicitFollowSymlinks = true; - g.RecurseThroughSymlinksOn(); - ++i; - if (i == args.end()) { - this->SetError( - "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS."); - return false; + ++i; // skip FOLLOW_SYMLINKS + if (recurse) { + explicitFollowSymlinks = true; + g.RecurseThroughSymlinksOn(); + if (i == args.end()) { + this->SetError( + "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS."); + return false; + } } } else if (*i == "RELATIVE") { ++i; // skip RELATIVE |