aboutsummaryrefslogtreecommitdiff
path: root/src/target.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-01-04 23:24:55 +0000
committerMike Buland <eichlan@xagasoft.com>2010-01-04 23:24:55 +0000
commitabe69082514b61181c6bc15a341895c971ecdc43 (patch)
treeffeb8791f5b95ba13c7c05f3c0d434c1755910dd /src/target.cpp
parentff9e70dfa03fa1fb21bbb6d7de5a8fd85f31bba3 (diff)
downloadbuild-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.cpp17
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
80void 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
79void Target::buildRequires( Runner &r ) 93void 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
113void Target::addOutput( const Bu::FString &sOutput ) 130void Target::addOutput( const Bu::FString &sOutput )