]> git.tdb.fi Git - builder.git/blobdiff - source/filetarget.cpp
Fix cascading of BuildInfo
[builder.git] / source / filetarget.cpp
index 9908c0d4d2836c36c5e05e1eda9aa221bab067b2..7de9b797761717ce968649931e29ea6a32b8920c 100644 (file)
@@ -30,6 +30,11 @@ void FileTarget::init(const SourcePackage *p)
 
        builder.get_vfs().register_path(path, this);
 
+       stat();
+}
+
+void FileTarget::stat()
+{
        if(FS::Stat st = FS::lstat(path))
        {
                mtime = st.get_modify_time();
@@ -39,9 +44,9 @@ void FileTarget::init(const SourcePackage *p)
 
 string FileTarget::generate_name(Builder &builder, const SourcePackage *pkg, const FS::Path &path)
 {
-       if(pkg && FS::descendant_depth(path, pkg->get_source())>=0)
+       if(pkg && FS::descendant_depth(path, pkg->get_source_directory())>=0)
        {
-               FS::Path relpath = FS::relative(path, pkg->get_source());
+               FS::Path relpath = FS::relative(path, pkg->get_source_directory());
                return format("<%s>%s", pkg->get_name(), relpath.str().substr(1));
        }
        else if(FS::descendant_depth(path, builder.get_prefix())>=0)
@@ -90,3 +95,11 @@ Task *FileTarget::build()
 
        return Target::build();
 }
+
+void FileTarget::build_finished(bool success)
+{
+       if(success)
+               stat();
+
+       Target::build_finished(success);
+}