X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstaticlibrary.cpp;h=92a3af044cfc1b55de875b3414a25b9226125684;hb=bf0883b6dd3946612922aa1b7c04a87d06442df7;hp=9a35677efcd3891d1a61e097e15e57016fbd6529;hpb=be8a901dfc026f61db46d5d64a41cecc619bc97d;p=builder.git diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index 9a35677..92a3af0 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -1,33 +1,46 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2007 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 std::list &objs): - Target(b, &c.get_package(), generate_target_name(c)), - comp(c) +StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list &objs): + 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); + + install_location = "lib"; + nested_build_sig = true; + arch_in_build_sig = true; +} + +string StaticLibrary::generate_filename(const Component &comp) +{ + const Architecture &arch = comp.get_package().get_builder().get_current_arch(); + return arch.create_filename(comp.get_name()); +} + +void StaticLibrary::add_required_library(const string &lib) +{ + build_info.libs.push_back(lib); } -Action *StaticLibrary::create_action() +void StaticLibrary::add_library_path(const FS::Path &pth) { - return new Archive(builder, *this); + build_info.libpath.push_back(pth); } -string StaticLibrary::generate_target_name(const Component &c) +void StaticLibrary::collect_build_info(BuildInfo &binfo) const { - return (c.get_package().get_out_dir()/("lib"+c.get_name()+".a")).str(); + Target::collect_build_info(binfo); + binfo.update_from(build_info); }