]> git.tdb.fi Git - builder.git/blob - source/virtualtarget.cpp
Add a method to query the existence of dependencies in cache
[builder.git] / source / virtualtarget.cpp
1 #include <msp/fs/path.h>
2 #include <msp/fs/utils.h>
3 #include "builder.h"
4 #include "virtualtarget.h"
5
6 using namespace std;
7 using namespace Msp;
8
9 VirtualTarget::VirtualTarget(Builder &b, const string &n):
10         Target(b, n)
11 { }
12
13 void VirtualTarget::check_rebuild()
14 {
15         // Virtual targets are only rebuilt if their dependencies need rebuilding.
16         for(Dependencies::iterator i=depends.begin(); (i!=depends.end() && !needs_rebuild()); ++i)
17                 if((*i)->needs_rebuild())
18                         mark_rebuild((*i)->get_name()+" needs rebuilding");
19 }