]> git.tdb.fi Git - builder.git/blob - source/lib/sharedlibrary.h
Add visibility decorations to the library and plugins
[builder.git] / source / lib / sharedlibrary.h
1 #ifndef SHAREDLIB_H_
2 #define SHAREDLIB_H_
3
4 #include "binary.h"
5 #include "libbuilder_api.h"
6
7 class ImportLibrary;
8
9 /**
10 Represents a shared library.  It has two special properties: libname and
11 soname.  Libname is the name used by the linker.  Soname is the canonical
12 filename of the library, including version number.  If the owning package has
13 no version, soname will be empty.
14
15 A SharedLibrary can also store a pointer to the associated ImportLibrary, for
16 platforms that need one.
17 */
18 class LIBBUILDER_API SharedLibrary: public Binary
19 {
20 private:
21         std::string libname;
22         std::string soname;
23         ImportLibrary *import_lib = 0;
24
25 public:
26         SharedLibrary(Builder &, const Msp::FS::Path &);
27         SharedLibrary(Builder &, const Component &, const std::vector<ObjectFile *> &);
28 private:
29         static std::string generate_filename(const Component &);
30
31 public:
32         const char *get_type() const override { return "SharedLibrary"; }
33         const std::string &get_libname() const { return libname; }
34         const std::string &get_soname() const { return soname; }
35
36         void set_import_library(ImportLibrary *);
37         ImportLibrary *get_import_library() const { return import_lib; }
38 };
39
40 #endif