summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-06 12:51:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-06 12:51:05 (GMT)
commit8317ea01aa3cf9319ef907e127fa6dbf9666cc53 (patch)
tree68c593e28b22ac0496001a35087ad3e226cf6b83 /Source
parent9109ba434782a3514f1bc6a5fd3c063d231008f2 (diff)
parentf6fd0abc5bbfa7d677cd090ba8e2894d96afdde8 (diff)
downloadCMake-8317ea01aa3cf9319ef907e127fa6dbf9666cc53.zip
CMake-8317ea01aa3cf9319ef907e127fa6dbf9666cc53.tar.gz
CMake-8317ea01aa3cf9319ef907e127fa6dbf9666cc53.tar.bz2
Merge topic 'genex-LINK_ONLY-not-linking'
f6fd0abc Genex: Diagnose invalid LINK_ONLY usage instead of crashing
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 44e9ce1..c19a741 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -672,15 +672,20 @@ static const struct LinkOnlyNode : public cmGeneratorExpressionNode
LinkOnlyNode() {}
std::string Evaluate(const std::vector<std::string>& parameters,
- cmGeneratorExpressionContext* /*context*/,
- const GeneratorExpressionContent* /*content*/,
+ cmGeneratorExpressionContext* context,
+ const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* dagChecker) const
CM_OVERRIDE
{
+ if (!dagChecker) {
+ reportError(context, content->GetOriginalExpression(),
+ "$<LINK_ONLY:...> may only be used for linking");
+ return std::string();
+ }
if (!dagChecker->GetTransitivePropertiesOnly()) {
return parameters.front();
}
- return "";
+ return std::string();
}
} linkOnlyNode;