aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-08-31 10:45:33 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-09-04 07:25:32 +0000
commit4661759492c8dfc2830248f5d696a63365fc9e07 (patch)
treebccdf006770569ed29bfd8a81624c0f056d59219
parent80bd4c413e03e3307b374982132779ddc80f914e (diff)
Fix over-eager sanity checkv1.12.1
It could trigger on legal constructs. The patch amends 9c1aa4ece1. Change-Id: I31eab78fdb58262f2e4935f4eebf4023e4a4adc0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/lib/corelib/buildgraph/buildgraph.cpp14
1 files 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<QString> childFilePaths;
for (const Artifact *a : filterByType<Artifact>(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<Artifact>(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);
+ }
}
}
}