mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
EvaluateExpression() returns std::string
This commit is contained in:
@@ -390,7 +390,7 @@ const char* cmGeneratorExpressionInterpreter::Evaluate(
|
||||
const char* expression, const std::string& property)
|
||||
{
|
||||
if (this->Target.empty()) {
|
||||
return this->EvaluateExpression(expression);
|
||||
return this->EvaluateExpression(expression).c_str();
|
||||
}
|
||||
|
||||
// Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS
|
||||
@@ -398,5 +398,5 @@ const char* cmGeneratorExpressionInterpreter::Evaluate(
|
||||
this->Target, property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property,
|
||||
nullptr, nullptr);
|
||||
|
||||
return this->EvaluateExpression(expression, &dagChecker);
|
||||
return this->EvaluateExpression(expression, &dagChecker).c_str();
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
|
||||
const char* Evaluate(const char* expression)
|
||||
{
|
||||
return this->EvaluateExpression(expression);
|
||||
return this->EvaluateExpression(expression).c_str();
|
||||
}
|
||||
const char* Evaluate(const std::string& expression)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ protected:
|
||||
const std::string& GetTargetName() const { return this->Target; }
|
||||
const std::string& GetLanguage() const { return this->Language; }
|
||||
|
||||
const char* EvaluateExpression(
|
||||
const std::string& EvaluateExpression(
|
||||
const char* expression,
|
||||
cmGeneratorExpressionDAGChecker* dagChecker = nullptr)
|
||||
{
|
||||
@@ -220,16 +220,13 @@ protected:
|
||||
this->GeneratorExpression.Parse(expression);
|
||||
|
||||
if (dagChecker == nullptr) {
|
||||
return this->CompiledGeneratorExpression
|
||||
->Evaluate(this->LocalGenerator, this->Config, false,
|
||||
this->GeneratorTarget)
|
||||
.c_str();
|
||||
return this->CompiledGeneratorExpression->Evaluate(
|
||||
this->LocalGenerator, this->Config, false, this->GeneratorTarget);
|
||||
}
|
||||
|
||||
return this->CompiledGeneratorExpression
|
||||
->Evaluate(this->LocalGenerator, this->Config, false,
|
||||
this->GeneratorTarget, dagChecker, this->Language)
|
||||
.c_str();
|
||||
return this->CompiledGeneratorExpression->Evaluate(
|
||||
this->LocalGenerator, this->Config, false, this->GeneratorTarget,
|
||||
dagChecker, this->Language);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user