diff options
author | Brad King <brad.king@kitware.com> | 2016-09-06 12:51:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-09-06 12:51:05 (GMT) |
commit | 8317ea01aa3cf9319ef907e127fa6dbf9666cc53 (patch) | |
tree | 68c593e28b22ac0496001a35087ad3e226cf6b83 /Source | |
parent | 9109ba434782a3514f1bc6a5fd3c063d231008f2 (diff) | |
parent | f6fd0abc5bbfa7d677cd090ba8e2894d96afdde8 (diff) | |
download | CMake-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.cxx | 11 |
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; |