diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-02-10 18:08:01 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-02-13 15:33:27 +0100 |
commit | e73f60919079fc7cb0f0ad6d50b1a364c7b0d2a6 (patch) | |
tree | 3ce15f1f9b336063d591999ce325ce28a6e21320 /src/lib/corelib/buildgraph/cycledetector.h | |
parent | a3634a6bbb193c47cdec887a6b29356c979961aa (diff) |
support transformers with an unknown number of outputs
To support different types of nodes in the build graph, we introduce
the base class BuildGraphNode. Artifact now derives from BuildGraphNode.
A RuleNode class is introduced that represents a rule in the build graph.
Rules are applied in the build phase and not in a pre-build phase
anymore.
The handling of moc has been revisited. The fixed automoc pre-build
phase is no more.
This is the squashed merge of a feature branch.
Task-number: QBS-370
Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/cycledetector.h')
-rw-r--r-- | src/lib/corelib/buildgraph/cycledetector.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lib/corelib/buildgraph/cycledetector.h b/src/lib/corelib/buildgraph/cycledetector.h index 6e55efac3..690b3509e 100644 --- a/src/lib/corelib/buildgraph/cycledetector.h +++ b/src/lib/corelib/buildgraph/cycledetector.h @@ -29,7 +29,8 @@ #ifndef QBS_CYCLEDETECTOR_H #define QBS_CYCLEDETECTOR_H -#include "artifactvisitor.h" +#include "buildgraphvisitor.h" +#include <language/forward_decls.h> #include <logging/logger.h> #include <QSet> @@ -37,23 +38,27 @@ namespace qbs { namespace Internal { -class CycleDetector : public ArtifactVisitor +class BuildGraphNode; + +class CycleDetector : private BuildGraphVisitor { public: CycleDetector(const Logger &logger); - void visitProject(const ResolvedProjectConstPtr &project); + void visitProject(const TopLevelProjectConstPtr &project); void visitProduct(const ResolvedProductConstPtr &product); - void visitArtifact(Artifact *artifact); private: - void doVisit(Artifact *artifact); + bool visit(Artifact *artifact); + bool visit(RuleNode *ruleNode); + + bool visitNode(BuildGraphNode *node); - QList<Artifact *> cycle(Artifact *doubleEntry); + QList<BuildGraphNode *> cycle(BuildGraphNode *doubleEntry); - QSet<Artifact *> m_allArtifacts; - QSet<Artifact *> m_artifactsInCurrentPath; - Artifact *m_parent; + QSet<BuildGraphNode *> m_allNodes; + QSet<BuildGraphNode *> m_nodesInCurrentPath; + BuildGraphNode *m_parent; Logger m_logger; }; |