]> git.tdb.fi Git - builder.git/blobdiff - source/filetarget.cpp
Move the Component reference to Target and make it a pointer
[builder.git] / source / filetarget.cpp
index f04e3101281d4a8f9cb10791503591c3a7caf0cb..2a60c2986bac2ec89f1454995f89283fe5d973da 100644 (file)
@@ -10,10 +10,12 @@ using namespace std;
 using namespace Msp;
 
 FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a):
-       Target(b, p, make_name(p, a)),
+       Target(b, make_name(p, a)),
        path(a),
        size(0)
 {
+       package = p;
+
        builder.get_vfs().register_path(path, this);
 
        if(FS::Stat st = FS::lstat(path))
@@ -39,7 +41,7 @@ void FileTarget::check_rebuild()
                mark_rebuild("Does not exist");
        else
        {
-               for(Dependencies::iterator i=depends.begin(); (i!=depends.end() && !rebuild); ++i)
+               for(Dependencies::iterator i=depends.begin(); (i!=depends.end() && !needs_rebuild()); ++i)
                {
                        FileTarget *ft = dynamic_cast<FileTarget *>(*i);
                        if(ft && ft->get_mtime()>mtime)
@@ -56,7 +58,7 @@ void FileTarget::check_rebuild()
        }
 
        const SourcePackage *spkg = dynamic_cast<const SourcePackage *>(package);
-       if(!rebuild && spkg && spkg->get_config().get_mtime()>mtime)
+       if(!needs_rebuild() && spkg && spkg->get_config().get_mtime()>mtime)
                mark_rebuild("Package options changed");
 }