summaryrefslogtreecommitdiffstats
path: root/src/build.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-04-09 15:57:02 (GMT)
committerEvan Martin <martine@danga.com>2013-04-09 15:57:02 (GMT)
commit8b9e3eaf7e7d2af4539eae167f92993f5ab84b86 (patch)
tree82582c0928cb33e12b4d0a6c68f7bd06ff5a9301 /src/build.h
parent76c8b11b0ad1c62ecdaa45fd553a6ac69c213663 (diff)
parent0a2fc151976277d8c0319cdc4ee3b1932b673d91 (diff)
downloadNinja-8b9e3eaf7e7d2af4539eae167f92993f5ab84b86.zip
Ninja-8b9e3eaf7e7d2af4539eae167f92993f5ab84b86.tar.gz
Ninja-8b9e3eaf7e7d2af4539eae167f92993f5ab84b86.tar.bz2
Merge branch 'dep-pipeless'
This merges a new mechanism for tracking "depfile" dependencies that is faster on all platforms but dramatically so on Windows.
Diffstat (limited to 'src/build.h')
-rw-r--r--src/build.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/build.h b/src/build.h
index 52c277a..9a16990 100644
--- a/src/build.h
+++ b/src/build.h
@@ -104,8 +104,18 @@ struct CommandRunner {
virtual ~CommandRunner() {}
virtual bool CanRunMore() = 0;
virtual bool StartCommand(Edge* edge) = 0;
- /// Wait for a command to complete.
- virtual Edge* WaitForCommand(ExitStatus* status, string* output) = 0;
+
+ /// The result of waiting for a command.
+ struct Result {
+ Result() : edge(NULL) {}
+ Edge* edge;
+ ExitStatus status;
+ string output;
+ bool success() const { return status == ExitSuccess; }
+ };
+ /// Wait for a command to complete, or return false if interrupted.
+ virtual bool WaitForCommand(Result* result) = 0;
+
virtual vector<Edge*> GetActiveEdges() { return vector<Edge*>(); }
virtual void Abort() {}
};
@@ -132,7 +142,8 @@ struct BuildConfig {
/// Builder wraps the build process: starting commands, updating status.
struct Builder {
Builder(State* state, const BuildConfig& config,
- BuildLog* log, DiskInterface* disk_interface);
+ BuildLog* build_log, DepsLog* deps_log,
+ DiskInterface* disk_interface);
~Builder();
/// Clean up after interrupted commands by deleting output files.
@@ -152,7 +163,7 @@ struct Builder {
bool Build(string* err);
bool StartEdge(Edge* edge, string* err);
- void FinishEdge(Edge* edge, bool success, const string& output);
+ void FinishCommand(CommandRunner::Result* result);
/// Used for tests.
void SetBuildLog(BuildLog* log) {
@@ -166,6 +177,10 @@ struct Builder {
BuildStatus* status_;
private:
+ bool ExtractDeps(CommandRunner::Result* result, const string& deps_type,
+ vector<Node*>* deps_nodes, TimeStamp* deps_mtime,
+ string* err);
+
DiskInterface* disk_interface_;
DependencyScan scan_;