Merge topic 'simplify-condition-context'
2379b3ae
cmConditionEvaluator: Remove GetConditionContext method02fce523
cmConditionEvaluator: Drop unnecessary path conversion
This commit is contained in:
commit
91d91d9d5d
|
@ -104,25 +104,6 @@ bool cmConditionEvaluator::IsTrue(
|
||||||
errorString, status, true);
|
errorString, status, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmListFileContext cmConditionEvaluator::GetConditionContext(
|
|
||||||
cmMakefile* mf,
|
|
||||||
const cmCommandContext& command,
|
|
||||||
const std::string& filePath)
|
|
||||||
{
|
|
||||||
cmListFileContext context =
|
|
||||||
cmListFileContext::FromCommandContext(
|
|
||||||
command,
|
|
||||||
filePath);
|
|
||||||
|
|
||||||
if(!mf->GetCMakeInstance()->GetIsInTryCompile())
|
|
||||||
{
|
|
||||||
cmOutputConverter converter(mf->GetStateSnapshot());
|
|
||||||
context.FilePath = converter.Convert(context.FilePath,
|
|
||||||
cmOutputConverter::HOME);
|
|
||||||
}
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
|
const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
|
||||||
cmExpandedCommandArgument const& argument) const
|
cmExpandedCommandArgument const& argument) const
|
||||||
|
|
|
@ -33,9 +33,6 @@ public:
|
||||||
std::string &errorString,
|
std::string &errorString,
|
||||||
cmake::MessageType &status);
|
cmake::MessageType &status);
|
||||||
|
|
||||||
static cmListFileContext GetConditionContext(cmMakefile* mf,
|
|
||||||
const cmCommandContext& command, std::string const& filePath);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Filter the given variable definition based on policy CMP0054.
|
// Filter the given variable definition based on policy CMP0054.
|
||||||
const char* GetDefinitionIfUnquoted(
|
const char* GetDefinitionIfUnquoted(
|
||||||
|
|
|
@ -108,8 +108,8 @@ IsFunctionBlocked(const cmListFileFunction& lff,
|
||||||
cmake::MessageType messType;
|
cmake::MessageType messType;
|
||||||
|
|
||||||
cmListFileContext conditionContext =
|
cmListFileContext conditionContext =
|
||||||
cmConditionEvaluator::GetConditionContext(
|
cmListFileContext::FromCommandContext(
|
||||||
&mf, this->Functions[c],
|
this->Functions[c],
|
||||||
this->GetStartingContext().FilePath);
|
this->GetStartingContext().FilePath);
|
||||||
|
|
||||||
cmConditionEvaluator conditionEvaluator(
|
cmConditionEvaluator conditionEvaluator(
|
||||||
|
@ -210,8 +210,8 @@ bool cmIfCommand
|
||||||
commandContext.Name = execContext.Name;
|
commandContext.Name = execContext.Name;
|
||||||
|
|
||||||
cmConditionEvaluator conditionEvaluator(
|
cmConditionEvaluator conditionEvaluator(
|
||||||
*(this->Makefile), cmConditionEvaluator::GetConditionContext(
|
*(this->Makefile), cmListFileContext::FromCommandContext(
|
||||||
this->Makefile, commandContext, execContext.FilePath),
|
commandContext, execContext.FilePath),
|
||||||
this->Makefile->GetBacktrace());
|
this->Makefile->GetBacktrace());
|
||||||
|
|
||||||
bool isTrue = conditionEvaluator.IsTrue(
|
bool isTrue = conditionEvaluator.IsTrue(
|
||||||
|
|
|
@ -56,8 +56,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
|
||||||
commandContext.Name = execContext.Name;
|
commandContext.Name = execContext.Name;
|
||||||
|
|
||||||
cmListFileContext conditionContext =
|
cmListFileContext conditionContext =
|
||||||
cmConditionEvaluator::GetConditionContext(
|
cmListFileContext::FromCommandContext(
|
||||||
&mf, commandContext,
|
commandContext,
|
||||||
this->GetStartingContext().FilePath);
|
this->GetStartingContext().FilePath);
|
||||||
|
|
||||||
cmConditionEvaluator conditionEvaluator(
|
cmConditionEvaluator conditionEvaluator(
|
||||||
|
|
Loading…
Reference in New Issue