From 4661759492c8dfc2830248f5d696a63365fc9e07 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 31 Aug 2018 10:45:33 +0200 Subject: Fix over-eager sanity check It could trigger on legal constructs. The patch amends 9c1aa4ece1. Change-Id: I31eab78fdb58262f2e4935f4eebf4023e4a4adc0 Reviewed-by: Christian Stenger --- src/lib/corelib/buildgraph/buildgraph.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp index e9767b942..ed48b427d 100644 --- a/src/lib/corelib/buildgraph/buildgraph.cpp +++ b/src/lib/corelib/buildgraph/buildgraph.cpp @@ -708,12 +708,16 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, for (const Artifact * const output : qAsConst(transformer->outputs)) { QBS_CHECK(output->transformer == transformer); transformerOutputChildren.unite(ArtifactSet::filtered(output->children)); - Set childFilePaths; for (const Artifact *a : filterByType(output->children)) { - if (!childFilePaths.insert(a->filePath()).second) { - throw ErrorInfo(QString::fromLatin1("There is more than one artifact for " - "file '%1' in the child list for output '%2'.") - .arg(a->filePath(), output->filePath()), CodeLocation(), true); + for (const Artifact *other : filterByType(output->children)) { + if (other != a && other->filePath() == a->filePath() + && (other->artifactType != Artifact::SourceFile + || a->artifactType != Artifact::SourceFile + || other->product == a->product)) { + throw ErrorInfo(QString::fromLatin1("There is more than one artifact for " + "file '%1' in the child list for output '%2'.") + .arg(a->filePath(), output->filePath()), CodeLocation(), true); + } } } } -- cgit v1.2.3