X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstaticlibrary.cpp;h=9ee4a9a79771326c019206bc402645e32aa0b2b8;hb=c75c89d2425ab0c69e94d45a5d956286838bbc67;hp=556ee54295963e8c55b7483947f6289160207da1;hpb=dc4b917034c9d3718f07139e2f0f3631a080c6f3;p=builder.git diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index 556ee54..9ee4a9a 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -1,3 +1,4 @@ +#include "builder.h" #include "component.h" #include "objectfile.h" #include "sourcepackage.h" @@ -7,20 +8,23 @@ using namespace std; using namespace Msp; StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p): - FileTarget(b, 0, p) + FileTarget(b, p) { } StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list &objs): - FileTarget(b, &c.get_package(), generate_target_path(c)) + FileTarget(b, c.get_package(), c.get_package().get_output_directory()/generate_filename(c)) { 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; } -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()); }