builder.get_vfs().register_path(path, this);
+ stat();
+}
+
+void FileTarget::stat()
+{
if(FS::Stat st = FS::lstat(path))
{
mtime = st.get_modify_time();
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)
return Target::build();
}
+
+void FileTarget::build_finished(bool success)
+{
+ if(success)
+ stat();
+
+ Target::build_finished(success);
+}