6 #include <msp/parser/loader.h>
10 #include "packageref.h"
15 A package is a distributable piece of software. They consist of one or more
16 Components and may depend on other packages. Packages also have configuration
17 to determine where files are installed and which features to include (features
23 /// Loads a package from a file.
24 class Loader: public Msp::Parser::Loader
28 Package &get_object() { return pkg; }
33 void require(const std::string &);
34 void program(const std::string &);
35 void library(const std::string &);
36 void headers(const std::string &);
40 Package(Builder &, const std::string &, const Msp::Path::Path &);
41 void set_path(const Msp::Path::Path &);
42 const std::string &get_name() const { return name; }
43 const Msp::Path::Path &get_source() const { return source; }
44 const ComponentList &get_components() const { return components; }
45 bool get_buildable() const { return buildable; }
46 const Config &get_config() const { return config; }
47 const PkgRefList &get_requires() const { return requires; }
48 const BuildInfo &get_build_info() const { return build_info; }
49 const BuildInfo &get_exported_binfo() const { return export_binfo; }
50 Builder &get_builder() const { return builder; }
51 bool get_need_path() const { return need_path; }
53 void create_build_info();
54 void process_options(const RawOptionMap &);
56 static Package *create(Builder &, const std::string &);
70 std::string description;
73 Msp::Path::Path source;
76 BuildInfo export_binfo;
77 ComponentList components;
79 bool build_info_ready;
84 Package(Builder &, const std::string &, const std::vector<std::string> &);
85 void init_buildable();
86 unsigned get_install_flags();