diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-07-30 20:58:40 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-07-30 22:03:17 (GMT) |
commit | 6491270e0d3699f5151c08ef41dce84724f9ffc1 (patch) | |
tree | f4caa3b0bc5262e73352394a4bb0ed534a765133 /Source/cmIfCommand.cxx | |
parent | af24e4ef6e216184b8c207728d6b0312ce3c1525 (diff) | |
download | CMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.zip CMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.tar.gz CMake-6491270e0d3699f5151c08ef41dce84724f9ffc1.tar.bz2 |
cmFunctionBlocker: Move check for matching args
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 63cdd20..418a74b 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -38,7 +38,9 @@ public: cm::string_view StartCommandName() const override { return "if"_s; } cm::string_view EndCommandName() const override { return "endif"_s; } - bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override; + bool ArgumentsMatch(cmListFileFunction const& lff, + cmMakefile&) const override; + bool Replay(std::vector<cmListFileFunction> const& functions, cmExecutionStatus& inStatus) override; @@ -48,18 +50,10 @@ public: bool ElseSeen = false; }; -bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, - cmMakefile&) +bool cmIfFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff, + cmMakefile&) const { - if (lff.Name.Lower == "endif") { - // if the endif has arguments, then make sure - // they match the arguments of the matching if - if (lff.Arguments.empty() || lff.Arguments == this->Args) { - return true; - } - } - - return false; + return lff.Arguments.empty() || lff.Arguments == this->Args; } bool cmIfFunctionBlocker::Replay( |