diff options
-rw-r--r-- | Source/cmGeneratorExpressionDAGChecker.cxx | 16 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionDAGChecker.h | 5 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 20 |
3 files changed, 40 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 5b79e35..a4d5453 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -22,7 +22,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( const GeneratorExpressionContent *content, cmGeneratorExpressionDAGChecker *parent) : Parent(parent), Target(target), Property(property), - Content(content), Backtrace(backtrace) + Content(content), Backtrace(backtrace), TransitivePropertiesOnly(false) { const cmGeneratorExpressionDAGChecker *top = this; const cmGeneratorExpressionDAGChecker *p = this->Parent; @@ -139,6 +139,20 @@ cmGeneratorExpressionDAGChecker::checkGraph() const } //---------------------------------------------------------------------------- +bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnly() +{ + const cmGeneratorExpressionDAGChecker *top = this; + const cmGeneratorExpressionDAGChecker *parent = this->Parent; + while (parent) + { + top = parent; + parent = parent->Parent; + } + + return top->TransitivePropertiesOnly; +} + +//---------------------------------------------------------------------------- bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt) { const cmGeneratorExpressionDAGChecker *top = this; diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 95d466a..06b23f9 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -54,6 +54,10 @@ struct cmGeneratorExpressionDAGChecker CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD) + bool GetTransitivePropertiesOnly(); + void SetTransitivePropertiesOnly() + { this->TransitivePropertiesOnly = true; } + private: Result checkGraph() const; @@ -65,6 +69,7 @@ private: const GeneratorExpressionContent * const Content; const cmListFileBacktrace Backtrace; Result CheckResult; + bool TransitivePropertiesOnly; }; #endif diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index e2af131..08d9d03 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -492,6 +492,24 @@ static const struct VersionEqualNode : public cmGeneratorExpressionNode } versionEqualNode; //---------------------------------------------------------------------------- +static const struct LinkOnlyNode : public cmGeneratorExpressionNode +{ + LinkOnlyNode() {} + + std::string Evaluate(const std::vector<std::string> ¶meters, + cmGeneratorExpressionContext *, + const GeneratorExpressionContent *, + cmGeneratorExpressionDAGChecker *dagChecker) const + { + if(!dagChecker->GetTransitivePropertiesOnly()) + { + return parameters.front(); + } + return ""; + } +} linkOnlyNode; + +//---------------------------------------------------------------------------- static const struct ConfigurationNode : public cmGeneratorExpressionNode { ConfigurationNode() {} @@ -1396,6 +1414,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) return &installPrefixNode; else if (identifier == "JOIN") return &joinNode; + else if (identifier == "LINK_ONLY") + return &linkOnlyNode; return 0; } |