]> git.tdb.fi Git - builder.git/blobdiff - source/staticlibrary.cpp
Move file-to-target mapping to a separate class
[builder.git] / source / staticlibrary.cpp
index 529aacc193aea8bb30acd58125d99ece41faa32f..f69f98f85fd141e7e0a386d7be01c6c3bf44780e 100644 (file)
@@ -1,26 +1,21 @@
-#include "archive.h"
 #include "component.h"
 #include "objectfile.h"
-#include "package.h"
+#include "sourcepackage.h"
 #include "staticlibrary.h"
 
 using namespace std;
 
-StaticLibrary::StaticLibrary(Builder &b, const Component &c, const std::list<ObjectFile *> &objs):
-       Target(b, &c.get_package(), generate_target_name(c)),
+StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
+       FileTarget(b, &c.get_package(), generate_target_path(c)),
+       Library(b, package, path, c.get_name()),
        comp(c)
 {
-       buildable=true;
+       buildable = true;
        for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
                add_depend(*i);
 }
 
-Action *StaticLibrary::build()
+Msp::FS::Path StaticLibrary::generate_target_path(const Component &c)
 {
-       return Target::build(new Archive(builder, *this));;
-}
-
-string StaticLibrary::generate_target_name(const Component &c)
-{
-       return (c.get_package().get_out_dir()/("lib"+c.get_name()+".a")).str();
+       return c.get_package().get_out_dir()/("lib"+c.get_name()+".a");
 }