]> git.tdb.fi Git - builder.git/blobdiff - source/sharedlibrary.cpp
Refactor transitive dependencies to work on all targets
[builder.git] / source / sharedlibrary.cpp
diff --git a/source/sharedlibrary.cpp b/source/sharedlibrary.cpp
deleted file mode 100644 (file)
index c4f42e5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <msp/fs/utils.h>
-#include <msp/strings/format.h>
-#include "component.h"
-#include "sharedlibrary.h"
-#include "sourcepackage.h"
-
-using namespace std;
-using namespace Msp;
-
-SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
-       FileTarget(b, &c.get_package(), generate_target_path(c)),
-       Binary(b, c, objs),
-       Library(b, &c.get_package(), path, c.get_name()),
-       soname(create_soname(c))
-{
-       install_location = "lib";
-       if(component->get_type()==Component::MODULE)
-       {
-               install_location += '/';
-               install_location += package->get_name();
-       }
-}
-
-string SharedLibrary::create_soname(const Component &c)
-{
-       const string &ver = c.get_package().get_version();
-       if(ver.empty())
-               return string();
-
-       unsigned dots = 0;
-       unsigned i = 0;
-       for(; i<ver.size(); ++i)
-               if(ver[i]=='.')
-               {
-                       ++dots;
-                       if(dots>=2)
-                               break;
-               }
-
-       return format("%s.%s", FS::basename(path), ver.substr(0, i));
-}