Commit b58aff90 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Genex: Extend EvaluatingLinkLibraries to also check the top target name.

This will allow testing whether we are evaluating the link libraries
of a particular target.
parent b1c19ce3
......@@ -139,7 +139,7 @@ cmGeneratorExpressionDAGChecker::checkGraph() const
}
//----------------------------------------------------------------------------
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt)
{
const cmGeneratorExpressionDAGChecker *top = this;
const cmGeneratorExpressionDAGChecker *parent = this->Parent;
......@@ -150,6 +150,12 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
}
const char *prop = top->Property.c_str();
if (tgt)
{
return top->Target == tgt && strcmp(prop, "LINK_LIBRARIES") == 0;
}
return (strcmp(prop, "LINK_LIBRARIES") == 0
|| strcmp(prop, "LINK_INTERFACE_LIBRARIES") == 0
|| strcmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
......
......@@ -47,7 +47,7 @@ struct cmGeneratorExpressionDAGChecker
void reportError(cmGeneratorExpressionContext *context,
const std::string &expr);
bool EvaluatingLinkLibraries();
bool EvaluatingLinkLibraries(const char *tgt = 0);
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) \
bool METHOD () const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment