5 #include <msp/datafile/objectloader.h>
6 #include <msp/fs/path.h>
8 #include "installmap.h"
15 Components specify things to be built. Each component may build one binary (it
16 may also build none), as well as install a bunch of headers. Components inherit
17 dependencies and build info from the package they belong to, and may also add
23 class Loader: public Msp::DataFile::ObjectLoader<Component>
28 void source(const std::string &);
29 void require(const std::string &);
45 SourcePackage &package;
53 InstallMap install_map;
56 Component(SourcePackage &, Type, const std::string &);
58 const SourcePackage &get_package() const { return package; }
59 Type get_type() const { return type; }
60 const std::string &get_name() const { return name; }
62 /** Returns a list of sources for the component. They may refer to
63 directories or individual files. */
64 const StringList &get_sources() const { return sources; }
67 /** Returns a list of all source files for the component. */
68 PathList collect_source_files() const;
71 bool get_install() const { return install; }
72 const InstallMap &get_install_map() const { return install_map; }
73 const PackageList &get_required_packages() const { return requires; }
74 bool is_default() const { return deflt; }
76 /** Prepares any required packages. */
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 const BuildInfo &get_build_info() const { return build_info; }
85 void create_targets() const;