1 #include <msp/fs/utils.h>
2 #include <msp/strings/format.h>
4 #include "sharedlibrary.h"
5 #include "sourcepackage.h"
10 SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
11 FileTarget(b, &c.get_package(), generate_target_path(c)),
13 Library(b, &c.get_package(), path, c.get_name()),
14 soname(create_soname(c))
16 install_location = "lib";
17 if(component->get_type()==Component::MODULE)
19 install_location += '/';
20 install_location += package->get_name();
24 string SharedLibrary::create_soname(const Component &c)
26 const string &ver = c.get_package().get_version();
32 for(; i<ver.size(); ++i)
40 return format("%s.%s", FS::basename(path), ver.substr(0, i));