From d1a2729b1af86a0a3abfb21df18ed85bcfaa59c6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 Feb 2013 11:08:24 +0100 Subject: [PATCH] Fix DAG checker finding cycling dependencies. Before this patch, the following is reported falsely as a self-reference: target_link_libraries(empty2 LINK_PUBLIC empty3) target_link_libraries(empty3 LINK_PUBLIC empty2) add_custom_target(... -DINCLUDES=$ ) The reason is that the existing code assumed that all reading of include directories would be done through cmTarget::GetIncludeDirectories() and would therefore be initialized with a DagChecker. That is not the case if reading the property with an 'external' generator expression. --- Source/cmGeneratorExpressionDAGChecker.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 57e7358b5..2d50c252d 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -126,7 +126,7 @@ cmGeneratorExpressionDAGChecker::checkGraph() const { if (this->Target == parent->Target && this->Property == parent->Property) { - return parent->Parent ? CYCLIC_REFERENCE : SELF_REFERENCE; + return (parent == this->Parent) ? SELF_REFERENCE : CYCLIC_REFERENCE; } parent = parent->Parent; }