summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-20 20:09:03 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-21 11:47:27 (GMT)
commitb2785a0fbdcfa703f3ad3aaa2949ec7db55a27d9 (patch)
treeaa5ddaa6da58a32b59730598b6341d77cdc26a12 /Source/cmGeneratorExpressionNode.cxx
parent2682714a3fd9bd65c07246264a792c151d7fe2a3 (diff)
downloadCMake-b2785a0fbdcfa703f3ad3aaa2949ec7db55a27d9.zip
CMake-b2785a0fbdcfa703f3ad3aaa2949ec7db55a27d9.tar.gz
CMake-b2785a0fbdcfa703f3ad3aaa2949ec7db55a27d9.tar.bz2
Genex: Move TARGET_PROPERTY linked targets evaluation to end
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx63
1 files changed, 28 insertions, 35 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index d828dac..1973e99 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1227,10 +1227,10 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
break;
}
- std::string prop;
+ std::string result;
bool haveProp = false;
if (const char* p = target->GetProperty(propertyName)) {
- prop = p;
+ result = p;
haveProp = true;
}
@@ -1264,8 +1264,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
}
- std::string linkedTargetsContent;
-
std::string interfacePropertyName;
bool isInterfaceProperty = false;
@@ -1287,32 +1285,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
}
#undef POPULATE_INTERFACE_PROPERTY_NAME
- cmGeneratorTarget const* headTarget =
- context->HeadTarget && isInterfaceProperty ? context->HeadTarget
- : target;
-
- if (isInterfaceProperty) {
- if (cmLinkInterfaceLibraries const* iface =
- target->GetLinkInterfaceLibraries(context->Config, headTarget,
- true)) {
- linkedTargetsContent =
- getLinkedTargetsContent(iface->Libraries, target, headTarget,
- context, &dagChecker, interfacePropertyName);
- }
- } else if (!interfacePropertyName.empty()) {
- if (cmLinkImplementationLibraries const* impl =
- target->GetLinkImplementationLibraries(context->Config)) {
- linkedTargetsContent =
- getLinkedTargetsContent(impl->Libraries, target, target, context,
- &dagChecker, interfacePropertyName);
- }
- }
- if (!haveProp) {
- if (target->IsImported() ||
- target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- return linkedTargetsContent;
- }
+ if (!haveProp && !target->IsImported() &&
+ target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
context->Config)) {
context->HadContextSensitiveCondition = true;
@@ -1345,8 +1320,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
context->Config);
return propContent ? propContent : "";
}
-
- return linkedTargetsContent;
}
if (!target->IsImported() && dagCheckerParent &&
@@ -1368,15 +1341,35 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return propContent ? propContent : "";
}
}
+
if (!interfacePropertyName.empty()) {
- std::string result = this->EvaluateDependentExpression(
- prop, context->LG, context, headTarget, target, &dagChecker);
+ cmGeneratorTarget const* headTarget =
+ context->HeadTarget && isInterfaceProperty ? context->HeadTarget
+ : target;
+ result = this->EvaluateDependentExpression(
+ result, context->LG, context, headTarget, target, &dagChecker);
+ std::string linkedTargetsContent;
+ if (isInterfaceProperty) {
+ if (cmLinkInterfaceLibraries const* iface =
+ target->GetLinkInterfaceLibraries(context->Config, headTarget,
+ true)) {
+ linkedTargetsContent = getLinkedTargetsContent(
+ iface->Libraries, target, headTarget, context, &dagChecker,
+ interfacePropertyName);
+ }
+ } else {
+ if (cmLinkImplementationLibraries const* impl =
+ target->GetLinkImplementationLibraries(context->Config)) {
+ linkedTargetsContent =
+ getLinkedTargetsContent(impl->Libraries, target, target, context,
+ &dagChecker, interfacePropertyName);
+ }
+ }
if (!linkedTargetsContent.empty()) {
result += (result.empty() ? "" : ";") + linkedTargetsContent;
}
- return result;
}
- return prop;
+ return result;
}
} targetPropertyNode;