diff options
author | Brad King <brad.king@kitware.com> | 2013-06-26 13:03:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-06-26 13:03:05 (GMT) |
commit | bef7c0251e397e6e4e01094c54ce5c3a333cf9ed (patch) | |
tree | 95cb019b4d5abb56a39a509fc1150d006b7133fa /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 63357bf9690c7a4ab95fd4114c09c07b4a123e26 (diff) | |
parent | ff015ee11e66388f50f9a1350e2731e7a240ccb1 (diff) | |
download | CMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.zip CMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.tar.gz CMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.tar.bz2 |
Merge topic 'dag-LINKER_LANGUAGE'
ff015ee Genex: Report error if a target file is needed to evaluate link libraries.
b58aff9 Genex: Extend EvaluatingLinkLibraries to also check the top target name.
b1c19ce Genex: Make LINK_LANGUAGE report an error when evaluating link libraries.
0e1cb07 Add missing return after error report.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index d95006e..037ef31 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -469,8 +469,15 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode std::string Evaluate(const std::vector<std::string> ¶meters, cmGeneratorExpressionContext *context, const GeneratorExpressionContent *content, - cmGeneratorExpressionDAGChecker *) const + cmGeneratorExpressionDAGChecker *dagChecker) const { + if (dagChecker && dagChecker->EvaluatingLinkLibraries()) + { + reportError(context, content->GetOriginalExpression(), + "$<LINK_LANGUAGE> expression can not be used while evaluating " + "link libraries"); + return std::string(); + } if (parameters.size() != 0 && parameters.size() != 1) { reportError(context, content->GetOriginalExpression(), @@ -483,6 +490,7 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode reportError(context, content->GetOriginalExpression(), "$<LINK_LANGUAGE> may only be used with targets. It may not " "be used with add_custom_command."); + return std::string(); } const char *lang = target->GetLinkerLanguage(context->Config); @@ -1146,7 +1154,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode std::string Evaluate(const std::vector<std::string> ¶meters, cmGeneratorExpressionContext *context, const GeneratorExpressionContent *content, - cmGeneratorExpressionDAGChecker *) const + cmGeneratorExpressionDAGChecker *dagChecker) const { // Lookup the referenced target. std::string name = *parameters.begin(); @@ -1171,6 +1179,13 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode "Target \"" + name + "\" is not an executable or library."); return std::string(); } + if (dagChecker && dagChecker->EvaluatingLinkLibraries(name.c_str())) + { + ::reportError(context, content->GetOriginalExpression(), + "Expressions which require the linker language may not " + "be used while evaluating link libraries"); + return std::string(); + } context->DependTargets.insert(target); context->AllTargets.insert(target); |