diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-01-04 23:24:55 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-01-04 23:24:55 +0000 |
commit | abe69082514b61181c6bc15a341895c971ecdc43 (patch) | |
tree | ffeb8791f5b95ba13c7c05f3c0d434c1755910dd /src/target.cpp | |
parent | ff9e70dfa03fa1fb21bbb6d7de5a8fd85f31bba3 (diff) | |
download | build-abe69082514b61181c6bc15a341895c971ecdc43.tar.gz build-abe69082514b61181c6bc15a341895c971ecdc43.tar.bz2 build-abe69082514b61181c6bc15a341895c971ecdc43.tar.xz build-abe69082514b61181c6bc15a341895c971ecdc43.zip |
The cache works...really well.
Diffstat (limited to '')
-rw-r--r-- | src/target.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/target.cpp b/src/target.cpp index 1846044..4f9dd77 100644 --- a/src/target.cpp +++ b/src/target.cpp | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "context.h" | 7 | #include "context.h" |
8 | #include "profile.h" | 8 | #include "profile.h" |
9 | #include "view.h" | 9 | #include "view.h" |
10 | #include "cache.h" | ||
10 | 11 | ||
11 | #include <bu/membuf.h> | 12 | #include <bu/membuf.h> |
12 | #include <bu/formatter.h> | 13 | #include <bu/formatter.h> |
@@ -76,6 +77,19 @@ const StrList &Target::getRequiresList() const | |||
76 | return lsRequires; | 77 | return lsRequires; |
77 | } | 78 | } |
78 | 79 | ||
80 | void Target::gatherRequires( Runner &r ) | ||
81 | { | ||
82 | Cache &c = Cache::getInstance(); | ||
83 | try | ||
84 | { | ||
85 | lsRequires = c.getRequires( lsOutput.first() ); | ||
86 | } | ||
87 | catch( Bu::HashException &e ) | ||
88 | { | ||
89 | buildRequires( r ); | ||
90 | } | ||
91 | } | ||
92 | |||
79 | void Target::buildRequires( Runner &r ) | 93 | void Target::buildRequires( Runner &r ) |
80 | { | 94 | { |
81 | r.getContext().getView()->buildRequires( *this ); | 95 | r.getContext().getView()->buildRequires( *this ); |
@@ -108,6 +122,9 @@ void Target::buildRequires( Runner &r ) | |||
108 | } | 122 | } |
109 | } | 123 | } |
110 | r.getContext().popScope(); | 124 | r.getContext().popScope(); |
125 | |||
126 | Cache &c = Cache::getInstance(); | ||
127 | c.setRequires( lsOutput.first(), lsRequires ); | ||
111 | } | 128 | } |
112 | 129 | ||
113 | void Target::addOutput( const Bu::FString &sOutput ) | 130 | void Target::addOutput( const Bu::FString &sOutput ) |