diff options
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-rw-r--r-- | Source/cmConditionEvaluator.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index e7e91c1..21df278 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -3,7 +3,7 @@ #include "cmConditionEvaluator.h" #include "cmsys/RegularExpression.hxx" -#include <algorithm> +#include <functional> #include <sstream> #include <stdio.h> #include <stdlib.h> @@ -14,10 +14,10 @@ #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 +219,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 +238,7 @@ bool cmConditionEvaluator::GetBooleanValue( // Check definition. const char* def = this->GetDefinitionIfUnquoted(arg); - return !cmSystemTools::IsOff(def); + return !cmIsOff(def); } //========================================================================= @@ -255,14 +255,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); } //========================================================================= @@ -452,7 +452,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); @@ -668,10 +668,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); |