aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/artifact.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-07-16 14:06:41 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-07-18 12:43:44 +0000
commitca08d7461ed51343ba04d835928f93340f23676c (patch)
tree7b9ed705b2f8b73f3ddf5a460111ef1a5ba1211c /src/lib/corelib/buildgraph/artifact.cpp
parent23eb52c2100b7f5f83b9b514ab3be11be7f46b2e (diff)
RulesApplicator: Fix assertion
There can be input artifacts that are produced by a rule that is not connected to the current rule. This happens if at least one of the outputs of the rule that produces the input matches the excluded inputs of the current rule, in which case there is no connection between the rules. Change-Id: If51344e95e971ae89745ce7c20c2623774af42ae Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/artifact.cpp')
-rw-r--r--src/lib/corelib/buildgraph/artifact.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/artifact.cpp b/src/lib/corelib/buildgraph/artifact.cpp
index 862d8e829..ecfe362f0 100644
--- a/src/lib/corelib/buildgraph/artifact.cpp
+++ b/src/lib/corelib/buildgraph/artifact.cpp
@@ -42,6 +42,7 @@
#include "transformer.h"
#include "buildgraphvisitor.h"
#include "productbuilddata.h"
+#include "rulenode.h"
#include <language/language.h>
#include <language/propertymapinternal.h>
#include <tools/persistence.h>
@@ -104,6 +105,15 @@ void Artifact::setFileTags(const FileTags &newFileTags)
removeFileTag(t);
}
+RuleNode *Artifact::producer() const
+{
+ if (artifactType == SourceFile)
+ return nullptr;
+ const auto ruleNodes = filterByType<RuleNode>(children);
+ QBS_CHECK(ruleNodes.begin() != ruleNodes.end());
+ return *ruleNodes.begin();
+}
+
void Artifact::initialize()
{
artifactType = Unknown;