diff options
| author | Christian Kandeler <christian.kandeler@digia.com> | 2012-11-30 10:45:50 +0100 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-12-05 11:10:57 +0100 |
| commit | a42474e5ce1c06ef2bfdc5d0ce8098b8e43be22b (patch) | |
| tree | 595d3b7122b67bd7efdc5fdf21fbf5cd94426160 /src/lib/buildgraph/rulesapplicator.cpp | |
| parent | c552cb2ab5c3be9d2c6209b076a71c9e37209c29 (diff) | |
| download | qbs-a42474e5ce1c06ef2bfdc5d0ce8098b8e43be22b.tar.gz | |
Some engine-related optimizations.
- Re-enable script program cache; it is safe to use now.
- Create a new evaluation context only for the first build of a project.
- To help with all of this, use a shared pointer for
RulesEvaluationContext, as it does not have a clear owner.
Change-Id: I90a7fcaf855573b756f29daff37038e98aa7c1fe
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/rulesapplicator.cpp')
| -rw-r--r-- | src/lib/buildgraph/rulesapplicator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/buildgraph/rulesapplicator.cpp b/src/lib/buildgraph/rulesapplicator.cpp index bd19b1242..7f62f1297 100644 --- a/src/lib/buildgraph/rulesapplicator.cpp +++ b/src/lib/buildgraph/rulesapplicator.cpp @@ -54,7 +54,7 @@ RulesApplicator::RulesApplicator(BuildProduct *product, ArtifactsPerFileTagMap & void RulesApplicator::applyAllRules() { - RulesEvaluationContext::Scope s(m_buildProduct->project->evaluationContext()); + RulesEvaluationContext::Scope s(m_buildProduct->project->evaluationContext().data()); foreach (const RuleConstPtr &rule, m_buildProduct->topSortedRules()) applyRule(rule); } @@ -173,7 +173,7 @@ void RulesApplicator::doApply(const ArtifactList &inputArtifacts) } m_transformer->setupOutputs(engine(), scope()); - m_transformer->createCommands(m_rule->script, engine()); + m_transformer->createCommands(m_rule->script, evalContext()); if (m_transformer->commands.isEmpty()) throw Error(QString("There's a rule without commands: %1.").arg(m_rule->toString()), m_rule->script->location); } @@ -291,7 +291,7 @@ QString RulesApplicator::resolveOutPath(const QString &path) const return result; } -RulesEvaluationContext *RulesApplicator::evalContext() const +RulesEvaluationContextPtr RulesApplicator::evalContext() const { return m_buildProduct->project->evaluationContext(); } |
