]> git.tdb.fi Git - builder.git/blobdiff - source/staticlibrary.cpp
Make tools capable of reporting a system-wide path used to locate input files
[builder.git] / source / staticlibrary.cpp
index 556ee54295963e8c55b7483947f6289160207da1..db04f0a80ef2ec9094acbace22d7b2187b78293d 100644 (file)
@@ -1,3 +1,4 @@
+#include "builder.h"
 #include "component.h"
 #include "objectfile.h"
 #include "sourcepackage.h"
@@ -11,7 +12,7 @@ StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p):
 { }
 
 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
-       FileTarget(b, &c.get_package(), generate_target_path(c))
+       FileTarget(b, &c.get_package(), c.get_package().get_out_dir()/generate_filename(c))
 {
        component = &c;
        for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
@@ -20,7 +21,8 @@ StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFi
        install_location = "lib";
 }
 
-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());
 }