]> git.tdb.fi Git - builder.git/blob - source/systemlibrary.cpp
Miscellaneous minor code cleanups
[builder.git] / source / systemlibrary.cpp
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include <msp/fs/path.h>
9 #include <msp/fs/utils.h>
10 #include "systemlibrary.h"
11
12 using namespace std;
13 using namespace Msp;
14
15 SystemLibrary::SystemLibrary(Builder &b, const FS::Path &p):
16         FileTarget(b, 0, p),
17         Library(b, 0, p, extract_libname(p))
18 { }
19
20 string SystemLibrary::extract_libname(const FS::Path &p)
21 {
22         string result=FS::basepart(FS::basename(p));
23         if(!result.compare(0, 3, "lib"))
24                 result.erase(0, 3);
25         return result;
26 }