Skip to content
Snippets Groups Projects
Commit 53164ac9 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmTarget: Remove some hardcoding of transitive property names.

parent 5dd8c014
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,17 @@ static const char* targetPropertyTransitiveWhitelist[] = {
, "INTERFACE_COMPILE_DEFINITIONS"
};
//----------------------------------------------------------------------------
struct TransitiveWhitelistCompare
{
explicit TransitiveWhitelistCompare(const std::string &needle)
: Needle(needle) {}
bool operator() (const char *item)
{ return strcmp(item, this->Needle.c_str()) == 0; }
private:
std::string Needle;
};
//----------------------------------------------------------------------------
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
......@@ -485,8 +496,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
}
if (interfacePropertyName == "INTERFACE_INCLUDE_DIRECTORIES"
|| interfacePropertyName == "INTERFACE_COMPILE_DEFINITIONS")
const char **transBegin = targetPropertyTransitiveWhitelist;
const char **transEnd = targetPropertyTransitiveWhitelist
+ (sizeof(targetPropertyTransitiveWhitelist) /
sizeof(*targetPropertyTransitiveWhitelist));
if (std::find_if(transBegin, transEnd,
TransitiveWhitelistCompare(interfacePropertyName)) != transEnd)
{
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
context->Config,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment