]> git.tdb.fi Git - builder.git/blobdiff - source/staticlibrary.cpp
Inline simple constructors
[builder.git] / source / staticlibrary.cpp
index 29abc0d36efda33358038d8db90f703e2458f5e4..039eb8e7e52c117a8e5b3dfa14bbf25b1064ddbd 100644 (file)
@@ -7,22 +7,36 @@
 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<ObjectFile *> &objs):
+StaticLibrary::StaticLibrary(Builder &b, const Component &c, const vector<ObjectFile *> &objs):
        FileTarget(b, c.get_package(), c.get_package().get_output_directory()/generate_filename(c))
 {
        component = &c;
-       for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
-               add_dependency(**i);
+       for(ObjectFile *o: objs)
+               add_dependency(*o);
 
        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.get_static_library_patterns().front().apply(comp.get_name());
+       return arch.create_filename<StaticLibrary>(comp.get_name());
+}
+
+void StaticLibrary::add_required_library(const string &lib)
+{
+       build_info.libs.push_back(lib);
+}
+
+void StaticLibrary::add_library_path(const FS::Path &pth)
+{
+       build_info.libpath.push_back(pth);
+}
+
+void StaticLibrary::collect_build_info(BuildInfo &binfo) const
+{
+       Target::collect_build_info(binfo);
+       binfo.update_from(build_info);
 }