]> git.tdb.fi Git - builder.git/blob - source/staticlibrary.cpp
Include libmode in library lookup hash
[builder.git] / source / staticlibrary.cpp
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "archive.h"
9 #include "component.h"
10 #include "objectfile.h"
11 #include "sourcepackage.h"
12 #include "staticlibrary.h"
13
14 using namespace std;
15
16 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const std::list<ObjectFile *> &objs):
17         Target(b, &c.get_package(), generate_target_name(c)),
18         comp(c)
19 {
20         buildable=true;
21         for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
22                 add_depend(*i);
23 }
24
25 Action *StaticLibrary::create_action()
26 {
27         return new Archive(builder, *this);
28 }
29
30 string StaticLibrary::generate_target_name(const Component &c)
31 {
32         return (c.get_package().get_out_dir()/("lib"+c.get_name()+".a")).str();
33 }