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