X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstaticlibrary.cpp;h=9ee4a9a79771326c019206bc402645e32aa0b2b8;hb=407b96515a5246384847d1835a2d69704e941ea1;hp=b7e4eff1d43941391393986f92c1acecd1bdab43;hpb=66d1078c04849ec17a7343d0494d6ed087e04318;p=builder.git diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index b7e4eff..9ee4a9a 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -1,34 +1,30 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "archive.h" +#include "builder.h" #include "component.h" #include "objectfile.h" #include "sourcepackage.h" #include "staticlibrary.h" using namespace std; +using namespace Msp; + +StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p): + FileTarget(b, p) +{ } StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list &objs): - FileTarget(b, &c.get_package(), generate_target_path(c)), - Library(b, package, path, c.get_name()), - comp(c) + FileTarget(b, c.get_package(), c.get_package().get_output_directory()/generate_filename(c)) { - buildable=true; + component = &c; for(list::const_iterator i=objs.begin(); i!=objs.end(); ++i) - add_depend(*i); -} + add_dependency(**i); -Action *StaticLibrary::create_action() -{ - return new Archive(builder, *this); + install_location = "lib"; + nested_build_sig = true; + arch_in_build_sig = true; } -Msp::FS::Path StaticLibrary::generate_target_path(const Component &c) +string StaticLibrary::generate_filename(const Component &comp) { - return c.get_package().get_out_dir()/("lib"+c.get_name()+".a"); + const Architecture &arch = comp.get_package().get_builder().get_current_arch(); + return arch.get_static_library_patterns().front().apply(comp.get_name()); }