diff options
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r-- | Source/cmConditionEvaluator.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index e7e91c1a8..003e60d57 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -2,22 +2,23 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConditionEvaluator.h" -#include "cmsys/RegularExpression.hxx" -#include <algorithm> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <functional> #include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #include <utility> +#include "cmsys/RegularExpression.hxx" + #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmState.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmake.h" -class cmCommand; class cmTest; static std::string const keyAND = "AND"; @@ -219,10 +220,10 @@ bool cmConditionEvaluator::GetBooleanValue( } // Check named constants. - if (cmSystemTools::IsOn(arg.c_str())) { + if (cmIsOn(arg.GetValue())) { return true; } - if (cmSystemTools::IsOff(arg.c_str())) { + if (cmIsOff(arg.GetValue())) { return false; } @@ -238,7 +239,7 @@ bool cmConditionEvaluator::GetBooleanValue( // Check definition. const char* def = this->GetDefinitionIfUnquoted(arg); - return !cmSystemTools::IsOff(def); + return !cmIsOff(def); } //========================================================================= @@ -255,14 +256,14 @@ bool cmConditionEvaluator::GetBooleanValueOld( return true; } const char* def = this->GetDefinitionIfUnquoted(arg); - return !cmSystemTools::IsOff(def); + return !cmIsOff(def); } // Old GetVariableOrNumber behavior. const char* def = this->GetDefinitionIfUnquoted(arg); if (!def && atoi(arg.c_str())) { def = arg.c_str(); } - return !cmSystemTools::IsOff(def); + return !cmIsOff(def); } //========================================================================= @@ -367,7 +368,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs, int reducible; do { reducible = 0; - cmArgumentList::iterator arg = newArgs.begin(); + auto arg = newArgs.begin(); while (arg != newArgs.end()) { if (IsKeyword(keyParenL, *arg)) { // search for the closing paren for this opening one @@ -393,7 +394,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs, std::vector<cmExpandedCommandArgument> newArgs2; // copy to the list structure - cmArgumentList::iterator argP1 = arg; + auto argP1 = arg; argP1++; cmAppend(newArgs2, argP1, argClose); newArgs2.pop_back(); @@ -424,7 +425,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, int reducible; do { reducible = 0; - cmArgumentList::iterator arg = newArgs.begin(); + auto arg = newArgs.begin(); cmArgumentList::iterator argP1; cmArgumentList::iterator argP2; while (arg != newArgs.end()) { @@ -452,7 +453,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&, } // does a command exist if (this->IsKeyword(keyCOMMAND, *arg) && argP1 != newArgs.end()) { - cmCommand* command = + cmState::Command command = this->Makefile.GetState()->GetCommand(argP1->c_str()); this->HandlePredicate(command != nullptr, reducible, arg, newArgs, argP1, argP2); @@ -524,7 +525,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, const char* def2; do { reducible = 0; - cmArgumentList::iterator arg = newArgs.begin(); + auto arg = newArgs.begin(); cmArgumentList::iterator argP1; cmArgumentList::iterator argP2; while (arg != newArgs.end()) { @@ -668,10 +669,9 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, def2 = this->Makefile.GetDefinition(argP2->GetValue()); if (def2) { - std::vector<std::string> list; - cmSystemTools::ExpandListArgument(def2, list, true); + std::vector<std::string> list = cmExpandedList(def2, true); - result = std::find(list.begin(), list.end(), def) != list.end(); + result = cmContains(list, def); } this->HandleBinaryOp(result, reducible, arg, newArgs, argP1, argP2); @@ -701,7 +701,7 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs, int reducible; do { reducible = 0; - cmArgumentList::iterator arg = newArgs.begin(); + auto arg = newArgs.begin(); cmArgumentList::iterator argP1; cmArgumentList::iterator argP2; while (arg != newArgs.end()) { @@ -729,7 +729,7 @@ bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs, bool rhs; do { reducible = 0; - cmArgumentList::iterator arg = newArgs.begin(); + auto arg = newArgs.begin(); cmArgumentList::iterator argP1; cmArgumentList::iterator argP2; while (arg != newArgs.end()) { |