]> git.tdb.fi Git - builder.git/blob - source/staticlibrary.cpp
Replace per-file copyright notices with a single file
[builder.git] / source / staticlibrary.cpp
1 #include "archive.h"
2 #include "component.h"
3 #include "objectfile.h"
4 #include "sourcepackage.h"
5 #include "staticlibrary.h"
6
7 using namespace std;
8
9 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
10         FileTarget(b, &c.get_package(), generate_target_path(c)),
11         Library(b, package, path, c.get_name()),
12         comp(c)
13 {
14         buildable = true;
15         for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
16                 add_depend(*i);
17 }
18
19 Action *StaticLibrary::create_action()
20 {
21         return new Archive(builder, *this);
22 }
23
24 Msp::FS::Path StaticLibrary::generate_target_path(const Component &c)
25 {
26         return c.get_package().get_out_dir()/("lib"+c.get_name()+".a");
27 }