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
37 Component &get_object() { return comp; }
39 virtual void finish();
40 void source(const std::string &);
41 void require(const std::string &);
43 void host(const std::string &);
44 void install_headers(const std::string &);
65 const Component *module_host;
72 Component(SourcePackage &, Type, const std::string &);
73 const SourcePackage &get_package() const { return pkg; }
74 Type get_type() const { return type; }
75 const std::string &get_name() const { return name; }
76 const PathList &get_sources() const { return sources; }
77 const BuildInfo &get_build_info() const { return build_info; }
78 bool get_install() const { return install; }
79 bool is_modular() const { return modular; }
80 const PackageList &get_requires() const { return requires; }
81 bool is_default() const { return deflt; }
83 /** Prepares the build information for building. Pulls build info from the
84 parent and dependency packages, and adds any component-specific flags. */
85 void create_build_info();
87 void create_targets() const;
90 /** Returns a list of all source files for the component. */
91 PathList collect_source_files() const;
94 typedef std::list<Component> ComponentList;