]> git.tdb.fi Git - builder.git/blob - source/component.cpp
Support custom build info
[builder.git] / source / component.cpp
1 #include "component.h"
2 #include "package.h"
3
4 using namespace std;
5
6 Component::Component(Package &p, Type t, const string &n):
7         pkg(p),
8         type(t),
9         name(n),
10         install(false)
11 { }
12
13 void Component::create_build_info()
14 {
15         build_info.add(pkg.get_build_info());
16         build_info.unique();
17 }
18
19 Component::Loader::Loader(Component &c):
20         comp(c)
21 {
22         add("source",          &Loader::source);
23         add("install",         &Component::install);
24         add("install_headers", &Component::install_headers);
25         add("build_info",      &Loader::build_info);
26 }
27
28 void Component::Loader::source(const string &s)
29 {
30         comp.sources.push_back(comp.pkg.get_source()/s);
31 }
32
33 void Component::Loader::build_info()
34 {
35         load_sub(comp.build_info);
36 }