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.
This commit is contained in:
Stephen Kelly 2013-06-14 15:58:04 +02:00
parent b1c19ce383
commit b58aff90c5
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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;