summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.h
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-08-09 18:50:17 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2018-08-09 18:50:17 (GMT)
commitc530e2f74ff466b43651372d56bae543eec1a9f1 (patch)
tree6f3762cfef1f404bc8c9ee5b6efa1a865e970591 /Source/cmGeneratorExpression.h
parentad4452d1bdabcdf039f812f2b709a905d76e8da0 (diff)
downloadCMake-c530e2f74ff466b43651372d56bae543eec1a9f1.zip
CMake-c530e2f74ff466b43651372d56bae543eec1a9f1.tar.gz
CMake-c530e2f74ff466b43651372d56bae543eec1a9f1.tar.bz2
cmCompiledGeneratorExpression::Evaluate(): return const std::string&
Diffstat (limited to 'Source/cmGeneratorExpression.h')
-rw-r--r--Source/cmGeneratorExpression.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 9fd53c6..2899317 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -72,16 +72,17 @@ class cmCompiledGeneratorExpression
CM_DISABLE_COPY(cmCompiledGeneratorExpression)
public:
- const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
- bool quiet = false,
- cmGeneratorTarget const* headTarget = nullptr,
- cmGeneratorTarget const* currentTarget = nullptr,
- cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
- std::string const& language = std::string()) const;
- const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
- bool quiet, cmGeneratorTarget const* headTarget,
- cmGeneratorExpressionDAGChecker* dagChecker,
- std::string const& language = std::string()) const;
+ const std::string& Evaluate(
+ cmLocalGenerator* lg, const std::string& config, bool quiet = false,
+ cmGeneratorTarget const* headTarget = nullptr,
+ cmGeneratorTarget const* currentTarget = nullptr,
+ cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
+ std::string const& language = std::string()) const;
+ const std::string& Evaluate(
+ cmLocalGenerator* lg, const std::string& config, bool quiet,
+ cmGeneratorTarget const* headTarget,
+ cmGeneratorExpressionDAGChecker* dagChecker,
+ std::string const& language = std::string()) const;
/** Get set of targets found during evaluations. */
std::set<cmGeneratorTarget*> const& GetTargets() const
@@ -126,7 +127,7 @@ public:
std::map<std::string, std::string>& mapping);
private:
- const char* EvaluateWithContext(
+ const std::string& EvaluateWithContext(
cmGeneratorExpressionContext& context,
cmGeneratorExpressionDAGChecker* dagChecker) const;
@@ -219,13 +220,16 @@ protected:
this->GeneratorExpression.Parse(expression);
if (dagChecker == nullptr) {
- return this->CompiledGeneratorExpression->Evaluate(
- this->LocalGenerator, this->Config, false, this->GeneratorTarget);
+ return this->CompiledGeneratorExpression
+ ->Evaluate(this->LocalGenerator, this->Config, false,
+ this->GeneratorTarget)
+ .c_str();
}
- return this->CompiledGeneratorExpression->Evaluate(
- this->LocalGenerator, this->Config, false, this->GeneratorTarget,
- dagChecker, this->Language);
+ return this->CompiledGeneratorExpression
+ ->Evaluate(this->LocalGenerator, this->Config, false,
+ this->GeneratorTarget, dagChecker, this->Language)
+ .c_str();
}
private: