diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 87 |
1 files changed, 51 insertions, 36 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 3407187..683245c 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -452,8 +452,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode const char *prop = target->GetProperty(propertyName.c_str()); - std::string linkedTargetsContent; - if (dagCheckerParent) { if (dagCheckerParent->EvaluatingLinkLibraries()) @@ -467,9 +465,40 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode { assert(dagCheckerParent->EvaluatingIncludeDirectories() || dagCheckerParent->EvaluatingCompileDefinitions()); + } + } + + std::string linkedTargetsContent; + + std::string interfacePropertyName; - if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES" - || propertyName == "INTERFACE_COMPILE_DEFINITIONS") + if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES" + || propertyName == "INCLUDE_DIRECTORIES") + { + interfacePropertyName = "INTERFACE_INCLUDE_DIRECTORIES"; + } + else if (propertyName == "INTERFACE_COMPILE_DEFINITIONS" + || propertyName == "COMPILE_DEFINITIONS" + || strncmp(propertyName.c_str(), "COMPILE_DEFINITIONS_", 20) == 0) + { + interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS"; + } + + if (interfacePropertyName == "INTERFACE_INCLUDE_DIRECTORIES" + || interfacePropertyName == "INTERFACE_COMPILE_DEFINITIONS") + { + const cmTarget::LinkInterface *iface = target->GetLinkInterface( + context->Config, + context->HeadTarget); + if(iface) + { + cmGeneratorExpression ge(context->Backtrace); + + std::string sep; + std::string depString; + for (std::vector<std::string>::const_iterator + it = iface->Libraries.begin(); + it != iface->Libraries.end(); ++it) { if (*it == target->GetName()) { @@ -478,40 +507,26 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode // self-referencing loop. continue; } - const cmTarget::LinkInterface *iface = target->GetLinkInterface( - context->Config, - context->HeadTarget); - if(iface) + if (context->Makefile->FindTargetToUse(it->c_str())) { - cmGeneratorExpression ge(context->Backtrace); - - std::string sep; - std::string depString; - for (std::vector<std::string>::const_iterator - it = iface->Libraries.begin(); - it != iface->Libraries.end(); ++it) - { - if (context->Makefile->FindTargetToUse(it->c_str())) - { - depString += - sep + "$<TARGET_PROPERTY:" + *it + "," + propertyName + ">"; - sep = ";"; - } - } - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(depString); - linkedTargetsContent = cge->Evaluate(context->Makefile, - context->Config, - context->Quiet, - context->HeadTarget, - target, - &dagChecker); - if (cge->GetHadContextSensitiveCondition()) - { - context->HadContextSensitiveCondition = true; - } + depString += + sep + "$<TARGET_PROPERTY:" + *it + "," + + interfacePropertyName + ">"; + sep = ";"; } } + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(depString); + linkedTargetsContent = cge->Evaluate(context->Makefile, + context->Config, + context->Quiet, + context->HeadTarget, + target, + &dagChecker); + if (cge->GetHadContextSensitiveCondition()) + { + context->HadContextSensitiveCondition = true; + } } } @@ -551,7 +566,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode sizeof(*targetPropertyTransitiveWhitelist)); ++i) { - if (targetPropertyTransitiveWhitelist[i] == propertyName) + if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName) { cmGeneratorExpression ge(context->Backtrace); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); |