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 &);
70 Component(SourcePackage &, Type, const std::string &);
71 const SourcePackage &get_package() const { return pkg; }
72 Type get_type() const { return type; }
73 const std::string &get_name() const { return name; }
74 const StringList &get_sources() const { return sources; }
75 const BuildInfo &get_build_info() const { return build_info; }
76 bool get_install() const { return install; }
77 const PackageList &get_requires() const { return requires; }
78 bool is_default() const { return deflt; }
80 void configure(const StringMap &, unsigned);
82 /** Prepares the build information for building. Pulls build info from the
83 parent and dependency packages, and adds any component-specific flags. */
84 void create_build_info();
86 void create_targets() const;
89 /** Returns a list of all source files for the component. */
90 PathList collect_source_files() const;
93 typedef std::list<Component> ComponentList;