From 67e7be2d7735fde833d07d998202adf94bbbf969 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 30 Dec 2009 15:00:09 +0000 Subject: Minor changes to the way requires are computed, getting ready for caching. --- build.sh | 4 ++-- src/cache.h | 2 ++ src/conditionfiletime.cpp | 2 +- src/target.cpp | 22 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index dd7e45b..53e9baa 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash -BUSRC="stack.cpp fstring.cpp fbasicstring.cpp hash.cpp list.cpp trace.cpp stream.cpp formatter.cpp util.cpp sharedcore.cpp exceptionbase.cpp heap.cpp archivebase.cpp archive.cpp queue.cpp archival.cpp sio.cpp stdstream.cpp process.cpp plugger.cpp optparser.cpp signals.cpp array.cpp membuf.cpp" -BUHDR="stack.h fstring.h fbasicstring.h hash.h list.h trace.h stream.h formatter.h util.h sharedcore.h exceptionbase.h heap.h archivebase.h archive.h queue.h archival.h sio.h stdstream.h process.h osx_compatibility.h win32_compatibility.h linux_compatibility.h plugger.h singleton.h optparser.h signals.h array.h membuf.h" +BUSRC="stack.cpp fstring.cpp fbasicstring.cpp hash.cpp list.cpp trace.cpp stream.cpp formatter.cpp util.cpp sharedcore.cpp exceptionbase.cpp heap.cpp archivebase.cpp archive.cpp queue.cpp archival.cpp sio.cpp stdstream.cpp process.cpp plugger.cpp optparser.cpp signals.cpp array.cpp membuf.cpp file.cpp" +BUHDR="stack.h fstring.h fbasicstring.h hash.h list.h trace.h stream.h formatter.h util.h sharedcore.h exceptionbase.h heap.h archivebase.h archive.h queue.h archival.h sio.h stdstream.h process.h osx_compatibility.h win32_compatibility.h linux_compatibility.h plugger.h singleton.h optparser.h signals.h array.h membuf.h file.h" function bld() { diff --git a/src/cache.h b/src/cache.h index b255e94..31da981 100644 --- a/src/cache.h +++ b/src/cache.h @@ -21,6 +21,8 @@ public: void load(); void save(); + + private: Bu::FString sCacheFile; bool bIsLoaded; diff --git a/src/conditionfiletime.cpp b/src/conditionfiletime.cpp index 224caf1..f34946f 100644 --- a/src/conditionfiletime.cpp +++ b/src/conditionfiletime.cpp @@ -51,7 +51,7 @@ bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) return true; } } - rTarget.buildRequires( r ); + // rTarget.buildRequires( r ); for( StrList::const_iterator j = rTarget.getRequiresList().begin(); j; j++ ) { diff --git a/src/target.cpp b/src/target.cpp index 8eec07a..ea043f9 100644 --- a/src/target.cpp +++ b/src/target.cpp @@ -217,6 +217,28 @@ void Target::process( class Runner &r, const Bu::FString &sProfile ) bRun = true; bool bShouldExec = false; + for( TargetList::iterator i = lDeps.begin(); i; i++ ) + { + if( (*i)->bRun ) + continue; + + // TODO: This is important, in the future, it may be possible for a + // target to be triggered by multiple dependant targets, to cover for + // this the below mergeUnder should be *TEMPORARY* and the target + // that was marged to be reset post processing. + (*i)->mergeUnder( hVars ); + (*i)->process( r, sProfile ); + } + try + { + bShouldExec = hProfiles.get( sProfile )->shouldExec( r, *this ); + } + catch( Bu::HashException &e ) + { + } + + buildRequires( r ); + for( TargetList::iterator i = lDeps.begin(); i; i++ ) { if( (*i)->bRun ) -- cgit v1.2.3