From b0ff4c93ff290b492305e269dfa8e3ab5fba33e4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 May 2014 16:28:10 +0200 Subject: pass file dependencies to recursive dependency scanners Recursive dependency scanners, like the C include file scanner, must be fed with file dependencies they've found. Task-number: QBS-566 Change-Id: I68a8e4a5cbb771ed2785ca69412a3b4c4e280eb2 Reviewed-by: Christian Kandeler --- src/lib/corelib/buildgraph/inputartifactscanner.cpp | 18 +++++++++++------- tests/auto/blackbox/tst_blackbox.cpp | 1 - 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp index b9fb6fea5..0f6161235 100644 --- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp +++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp @@ -311,14 +311,18 @@ unresolved: continue; resolved: - // Do not scan artifacts that are being built. Otherwise we might read an incomplete - // file or conflict with the writing process. - if (artifactsToScan) { - Artifact *artifactDependency = dynamic_cast(resolvedDependency->file); - if (artifactDependency && artifactDependency->buildState != BuildGraphNode::Building) - artifactsToScan->append(artifactDependency); - } handleDependency(*resolvedDependency); + if (artifactsToScan && resolvedDependency->file) { + if (Artifact *artifactDependency = dynamic_cast(resolvedDependency->file)) { + // Do not scan artifacts that are being built. Otherwise we might read an incomplete + // file or conflict with the writing process. + if (artifactDependency->buildState != BuildGraphNode::Building) + artifactsToScan->append(artifactDependency); + } else { + // Add file dependency to the next round of scanning. + artifactsToScan->append(resolvedDependency->file); + } + } } } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 51ac5121b..cc68a57d4 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1560,7 +1560,6 @@ void TestBlackbox::fileDependencies() waitForNewTimestamp(); touch("awesomelib/magnificent.h"); QCOMPARE(runQbs(), 0); - QEXPECT_FAIL("", "QBS-566", Abort); QVERIFY(m_qbsStdout.contains("compiling narf.cpp")); QVERIFY(!m_qbsStdout.contains("compiling zort.cpp")); } -- cgit v1.2.3