aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/executor.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-01-13 17:57:59 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-01-13 18:04:11 +0100
commit1bd973e88639588de56b88835670915642481020 (patch)
treeb6e3641ef2e75937ca16238010bbda3b2db4b052 /src/lib/corelib/buildgraph/executor.cpp
parent81af9acaa295a574c1cb5e6714725197dac7f530 (diff)
parentfce20ac83943d94e3bd465c41b03bd1e5d0c756f (diff)
Merge remote-tracking branch 'origin/1.1'
Diffstat (limited to 'src/lib/corelib/buildgraph/executor.cpp')
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index c1f7c6af3..fe546c97b 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -281,13 +281,8 @@ void Executor::doBuild()
// find the root nodes
m_roots.clear();
foreach (const ResolvedProductPtr &product, m_productsToBuild) {
- foreach (Artifact *targetArtifact, product->buildData->targetArtifacts) {
+ foreach (Artifact *targetArtifact, product->buildData->targetArtifacts)
m_roots += targetArtifact;
-
- // The user expects that he can delete target artifacts and they get rebuilt.
- // To achieve this we must retrieve their timestamps.
- targetArtifact->setTimestamp(FileInfo(targetArtifact->filePath()).lastModified());
- }
}
prepareReachableArtifacts(initialBuildState);
@@ -412,14 +407,24 @@ bool Executor::isUpToDate(Artifact *artifact) const
bool Executor::mustExecuteTransformer(const TransformerPtr &transformer) const
{
- foreach (Artifact *artifact, transformer->outputs)
- if (artifact->alwaysUpdated)
- return !isUpToDate(artifact);
+ bool hasAlwaysUpdatedArtifacts = false;
+ foreach (Artifact *artifact, transformer->outputs) {
+ if (!artifact->alwaysUpdated)
+ continue;
+ hasAlwaysUpdatedArtifacts = true;
+ const bool upToDate = isUpToDate(artifact);
- // All outputs of the transformer have alwaysUpdated == false.
- // We need at least on output that is always updated.
- QBS_CHECK(false);
- return true;
+ // The invariant is that all output artifacts of a transformer have the same
+ // "virtual" timestamp. However, if the user requested that on-disk timestamps be evaluated,
+ // they can differ and the oldest output file of the transformer decides.
+ if (!upToDate || !m_buildOptions.forceTimestampCheck())
+ return !upToDate;
+ }
+
+ // We need at least one output that is always updated.
+ QBS_CHECK(hasAlwaysUpdatedArtifacts);
+
+ return false;
}
void Executor::buildArtifact(Artifact *artifact)