]> git.tdb.fi Git - builder.git/blobdiff - source/filetarget.cpp
Make the name of a FileTarget be its basename instead of full path
[builder.git] / source / filetarget.cpp
index 37cc65ca06ee282db3b8a62d41c9bc14ba1f8463..8f35cfc9ed3b54f776f30159ab7e909fb5ed4843 100644 (file)
@@ -7,17 +7,19 @@ Distributed under the LGPL
 
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
-#include "file.h"
+#include "builder.h"
+#include "filetarget.h"
 
 using namespace std;
 using namespace Msp;
 
 FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a):
-       // XXX Builder depends on target name being its path for locating file targets
-       Target(b, p, /*FS::basename*/(a.str())),
+       Target(b, p, FS::basename(a.str())),
        path(a),
        size(0)
 {
+       builder.add_target(this);
+
        struct stat st;
        if(!FS::stat(path, st))
        {