]> git.tdb.fi Git - builder.git/blobdiff - source/systemlibrary.cpp
Rework the Target class hierarchy
[builder.git] / source / systemlibrary.cpp
index 2df0eb54e89a663b8ef7cab5049a84030670026b..2bfc04bb6f870e30cc6f890cff86ac1510d6058e 100644 (file)
@@ -12,10 +12,15 @@ Distributed under the LGPL
 using namespace std;
 using namespace Msp;
 
-SystemLibrary::SystemLibrary(Builder &b, const string &n):
-       Target(b, 0, n)
+SystemLibrary::SystemLibrary(Builder &b, const Msp::FS::Path &p):
+       FileTarget(b, 0, p),
+       Library(b, 0, p, extract_libname(p))
+{ }
+
+string SystemLibrary::extract_libname(const Msp::FS::Path &p)
 {
-       libname=FS::basepart(FS::basename(n));
-       if(!libname.compare(0, 3, "lib"))
-               libname.erase(0, 3);
+       string result=FS::basepart(FS::basename(p));
+       if(!result.compare(0, 3, "lib"))
+               result.erase(0, 3);
+       return result;
 }