]> git.tdb.fi Git - builder.git/blob - source/staticlibrary.cpp
Inline simple constructors
[builder.git] / source / staticlibrary.cpp
1 #include "builder.h"
2 #include "component.h"
3 #include "objectfile.h"
4 #include "sourcepackage.h"
5 #include "staticlibrary.h"
6
7 using namespace std;
8 using namespace Msp;
9
10 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const vector<ObjectFile *> &objs):
11         FileTarget(b, c.get_package(), c.get_package().get_output_directory()/generate_filename(c))
12 {
13         component = &c;
14         for(ObjectFile *o: objs)
15                 add_dependency(*o);
16
17         install_location = "lib";
18         nested_build_sig = true;
19         arch_in_build_sig = true;
20 }
21
22 string StaticLibrary::generate_filename(const Component &comp)
23 {
24         const Architecture &arch = comp.get_package().get_builder().get_current_arch();
25         return arch.create_filename<StaticLibrary>(comp.get_name());
26 }
27
28 void StaticLibrary::add_required_library(const string &lib)
29 {
30         build_info.libs.push_back(lib);
31 }
32
33 void StaticLibrary::add_library_path(const FS::Path &pth)
34 {
35         build_info.libpath.push_back(pth);
36 }
37
38 void StaticLibrary::collect_build_info(BuildInfo &binfo) const
39 {
40         Target::collect_build_info(binfo);
41         binfo.update_from(build_info);
42 }