]> git.tdb.fi Git - builder.git/blobdiff - source/sourcepackage.cpp
Pass the full path to the Build file to SourcePackage and create a target for it
[builder.git] / source / sourcepackage.cpp
index 4b45bb73b643a5f7b3934f51bed4a40b2a1ad036..d0524e84dab7af88e1d48f40c63fdded7b00e677 100644 (file)
@@ -1,9 +1,11 @@
 #include <cstdlib>
+#include <msp/fs/utils.h>
 #include <msp/io/print.h>
 #include <msp/strings/lexicalcast.h>
 #include <msp/strings/utils.h>
 #include "binarypackage.h"
 #include "builder.h"
+#include "file.h"
 #include "misc.h"
 #include "pkgconfigfile.h"
 #include "tool.h"
@@ -20,15 +22,18 @@ bool component_sort(const Component &c1, const Component &c2)
 }
 
 
-SourcePackage::SourcePackage(Builder &b, const string &n, const FS::Path &s):
+SourcePackage::SourcePackage(Builder &b, const string &n, const FS::Path &f):
        Package(b, n),
-       source_dir(s),
+       source_dir(FS::dirname(f)),
        build_type(0),
        config(*this),
        deps_cache(*this)
 {
        config.load();
 
+       build_file = builder.get_vfs().get_target(f);
+       if(!build_file)
+               build_file = new File(builder, *this, f);
        components.push_back(Component(*this, Component::TARBALL, "@src"));
 }