diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-12-10 10:31:59 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-01-05 00:05:09 (GMT) |
commit | 77475fe61d0a1bbd562228bf66d5043bd001cb48 (patch) | |
tree | 868ea2283bc32a00aa7085248bda8352ac91a2f9 /Source | |
parent | b2f1700bc7caf12c3f28890ebe183ae09c90d7dc (diff) | |
download | CMake-77475fe61d0a1bbd562228bf66d5043bd001cb48.zip CMake-77475fe61d0a1bbd562228bf66d5043bd001cb48.tar.gz CMake-77475fe61d0a1bbd562228bf66d5043bd001cb48.tar.bz2 |
Allow generator expressions to require literals.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index e20e203..a67cad5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -47,6 +47,8 @@ struct cmGeneratorExpressionNode virtual bool GeneratesContent() const { return true; } + virtual bool RequiresLiteralInput() const { return false; } + virtual bool AcceptsSingleArbitraryContentParameter() const { return false; } @@ -692,6 +694,15 @@ std::string GeneratorExpressionContent::Evaluate( = pit->end(); for ( ; it != end; ++it) { + if (node->RequiresLiteralInput()) + { + if ((*it)->GetType() != cmGeneratorExpressionEvaluator::Text) + { + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires literal input."); + return std::string(); + } + } result += (*it)->Evaluate(context, dagChecker); if (context->HadError) { @@ -699,6 +710,12 @@ std::string GeneratorExpressionContent::Evaluate( } } } + if (node->RequiresLiteralInput()) + { + std::vector<std::string> parameters; + parameters.push_back(result); + return node->Evaluate(parameters, context, this, dagChecker); + } return result; } |