]> git.tdb.fi Git - builder.git/blob - source/staticlibrary.cpp
Get rid of the Library and SystemLibrary classes as unnecessary abstractions
[builder.git] / source / staticlibrary.cpp
1 #include "component.h"
2 #include "objectfile.h"
3 #include "sourcepackage.h"
4 #include "staticlibrary.h"
5
6 using namespace std;
7 using namespace Msp;
8
9 StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p):
10         FileTarget(b, 0, p)
11 { }
12
13 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
14         FileTarget(b, &c.get_package(), generate_target_path(c))
15 {
16         component = &c;
17         for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
18                 add_depend(*i);
19
20         install_location = "lib";
21 }
22
23 Msp::FS::Path StaticLibrary::generate_target_path(const Component &c)
24 {
25         return c.get_package().get_out_dir()/("lib"+c.get_name()+".a");
26 }