3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
12 #include <msp/datafile/loader.h>
13 #include <msp/path/path.h>
14 #include "buildinfo.h"
21 Components specify things to be built. Each component may build one binary (it
22 may also build none), as well as install a bunch of headers. Components inherit
23 dependencies and build info from the package they belong to, and may also add
29 /// Loads a Component from file. Used from Package::Loader.
30 class Loader: public Msp::DataFile::Loader
34 Component &get_object() { return comp; }
38 void source(const std::string &);
39 void require(const std::string &);
41 void host(const std::string &);
53 Component(SourcePackage &, Type, const std::string &);
54 const SourcePackage &get_package() const { return pkg; }
55 Type get_type() const { return type; }
56 const std::string &get_name() const { return name; }
57 const PathList &get_sources() const { return sources; }
58 const BuildInfo &get_build_info() const { return build_info; }
59 bool get_install() const { return install; }
60 const std::string &get_install_headers() const { return install_headers; }
61 bool get_modular() const { return modular; }
62 const PackageList &get_requires() const { return requires; }
63 bool get_default() const { return deflt; }
64 void create_build_info();
65 void create_targets() const;
72 std::string install_headers;
73 const Component *module_host;
79 PathList collect_source_files() const;
81 typedef std::list<Component> ComponentList;