|
@@ -469,8 +469,15 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode
|
|
|
std::string Evaluate(const std::vector<std::string> ¶meters,
|
|
std::string Evaluate(const std::vector<std::string> ¶meters,
|
|
|
cmGeneratorExpressionContext *context,
|
|
cmGeneratorExpressionContext *context,
|
|
|
const GeneratorExpressionContent *content,
|
|
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)
|
|
if (parameters.size() != 0 && parameters.size() != 1)
|
|
|
{
|
|
{
|
|
|
reportError(context, content->GetOriginalExpression(),
|
|
reportError(context, content->GetOriginalExpression(),
|
|
@@ -483,6 +490,7 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode
|
|
|
reportError(context, content->GetOriginalExpression(),
|
|
reportError(context, content->GetOriginalExpression(),
|
|
|
"$<LINK_LANGUAGE> may only be used with targets. It may not "
|
|
"$<LINK_LANGUAGE> may only be used with targets. It may not "
|
|
|
"be used with add_custom_command.");
|
|
"be used with add_custom_command.");
|
|
|
|
|
+ return std::string();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const char *lang = target->GetLinkerLanguage(context->Config);
|
|
const char *lang = target->GetLinkerLanguage(context->Config);
|
|
@@ -1146,7 +1154,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
|
|
|
std::string Evaluate(const std::vector<std::string> ¶meters,
|
|
std::string Evaluate(const std::vector<std::string> ¶meters,
|
|
|
cmGeneratorExpressionContext *context,
|
|
cmGeneratorExpressionContext *context,
|
|
|
const GeneratorExpressionContent *content,
|
|
const GeneratorExpressionContent *content,
|
|
|
- cmGeneratorExpressionDAGChecker *) const
|
|
|
|
|
|
|
+ cmGeneratorExpressionDAGChecker *dagChecker) const
|
|
|
{
|
|
{
|
|
|
// Lookup the referenced target.
|
|
// Lookup the referenced target.
|
|
|
std::string name = *parameters.begin();
|
|
std::string name = *parameters.begin();
|
|
@@ -1171,6 +1179,13 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
|
|
|
"Target \"" + name + "\" is not an executable or library.");
|
|
"Target \"" + name + "\" is not an executable or library.");
|
|
|
return std::string();
|
|
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->DependTargets.insert(target);
|
|
|
context->AllTargets.insert(target);
|
|
context->AllTargets.insert(target);
|
|
|
|
|
|