3 This file is part of builder
4 Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
12 #include <msp/datafile/loader.h>
13 #include <msp/fs/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 class Loader: public Msp::DataFile::Loader
36 Component &get_object() { return comp; }
38 void source(const std::string &);
39 void require(const std::string &);
41 void host(const std::string &);
59 std::string install_headers;
60 const Component *module_host;
67 Component(SourcePackage &, Type, const std::string &);
68 const SourcePackage &get_package() const { return pkg; }
69 Type get_type() const { return type; }
70 const std::string &get_name() const { return name; }
71 const PathList &get_sources() const { return sources; }
72 const BuildInfo &get_build_info() const { return build_info; }
73 bool get_install() const { return install; }
74 const std::string &get_install_headers() const { return install_headers; }
75 bool get_modular() const { return modular; }
76 const PackageList &get_requires() const { return requires; }
77 bool get_default() const { return deflt; }
79 /** Prepares the build information for building. Pulls build info from the
80 parent and dependency packages, and adds any component-specific flags. */
81 void create_build_info();
83 void create_targets() const;
86 /** Returns a list of all source files for the component. */
87 PathList collect_source_files() const;
90 typedef std::list<Component> ComponentList;