]> git.tdb.fi Git - builder.git/blob - source/lib/binarycomponent.h
Add visibility decorations to the library and plugins
[builder.git] / source / lib / binarycomponent.h
1 #ifndef BINARYCOMPONENT_H_
2 #define BINARYCOMPONENT_H_
3
4 #include "component.h"
5 #include "libbuilder_api.h"
6
7 class FileTarget;
8 class Target;
9 class Tool;
10
11 class LIBBUILDER_API BinaryComponent: public Component
12 {
13 public:
14         class Loader: public Msp::DataFile::DerivedObjectLoader<BinaryComponent, Component::Loader>
15         {
16         public:
17                 Loader(BinaryComponent &);
18         private:
19                 void use(const std::string &);
20         };
21
22         enum Type
23         {
24                 LIBRARY,
25                 PROGRAM,
26                 MODULE
27         };
28
29 private:
30         Type type;
31         std::vector<const Component *> uses;
32
33 public:
34         BinaryComponent(SourcePackage &p, const std::string &n, Type t): Component(p, n), type(t) { }
35
36         Type get_type() const { return type; }
37
38         void create_build_info() override;
39         void update_exported_build_info(BuildInfo &) const override;
40         void create_targets() const override;
41 private:
42         std::vector<FileTarget *> create_sources() const;
43         static std::vector<Target *> extract_group(std::vector<FileTarget *> &, const Tool &);
44         void create_install(FileTarget &) const;
45 };
46
47 #endif