From abe69082514b61181c6bc15a341895c971ecdc43 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 4 Jan 2010 23:24:55 +0000 Subject: The cache works...really well. --- src/target.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/target.cpp') 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 @@ #include "context.h" #include "profile.h" #include "view.h" +#include "cache.h" #include #include @@ -76,6 +77,19 @@ const StrList &Target::getRequiresList() const return lsRequires; } +void Target::gatherRequires( Runner &r ) +{ + Cache &c = Cache::getInstance(); + try + { + lsRequires = c.getRequires( lsOutput.first() ); + } + catch( Bu::HashException &e ) + { + buildRequires( r ); + } +} + void Target::buildRequires( Runner &r ) { r.getContext().getView()->buildRequires( *this ); @@ -108,6 +122,9 @@ void Target::buildRequires( Runner &r ) } } r.getContext().popScope(); + + Cache &c = Cache::getInstance(); + c.setRequires( lsOutput.first(), lsRequires ); } void Target::addOutput( const Bu::FString &sOutput ) -- cgit v1.2.3