mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-23 00:48:55 +08:00
Workaround broken code where a target has itself in its link iface.
There is a test for this since commit 8e756d2b
(Tolerate cycles in
shared library link interfaces (#12647), 2012-01-12), so make sure
it continues to pass, even as we require no self-references in new
INTERFACE_ property generator expressions.
This commit is contained in:
@@ -471,6 +471,13 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||||||
if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
|
if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
|
||||||
|| propertyName == "INTERFACE_COMPILE_DEFINITIONS")
|
|| propertyName == "INTERFACE_COMPILE_DEFINITIONS")
|
||||||
{
|
{
|
||||||
|
if (*it == target->GetName())
|
||||||
|
{
|
||||||
|
// Broken code can have a target in its own link interface.
|
||||||
|
// Don't follow such link interface entries so as not to create a
|
||||||
|
// self-referencing loop.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
|
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
|
||||||
context->Config,
|
context->Config,
|
||||||
context->HeadTarget);
|
context->HeadTarget);
|
||||||
|
Reference in New Issue
Block a user