]> git.tdb.fi Git - builder.git/blobdiff - source/lib/binary.cpp
Correctly fetch libmode when looking for dependencies of Binary
[builder.git] / source / lib / binary.cpp
index f245037b6b24abe35662b46ab04219dad5de7e7f..ff8d658b13e9781e1640d2401564ae8578b1745c 100644 (file)
@@ -28,9 +28,13 @@ Binary::Binary(Builder &b, const Component &c, const string &p, const vector<Obj
 
 void Binary::collect_build_info(BuildInfo &binfo) const
 {
+       vector<const Tool *> tools;
        for(ObjectFile *o: objects)
                if(const Tool *obj_tool = o->get_tool())
-                       binfo.update_from(obj_tool->get_build_info());
+                       if(!any_equals(tools, obj_tool))
+                               tools.push_back(obj_tool);
+       for(const Tool *t: tools)
+               binfo.update_from(t->get_build_info());
 
        Target::collect_build_info(binfo);
 
@@ -72,7 +76,7 @@ void Binary::find_dependencies(Target *tgt, vector<Target *> &static_libs, vecto
                if(l.size()>10 && !l.compare(l.size()-10, 10, ".framework"))
                        continue;
 
-               BuildInfo::LibraryMode libmode = component->get_build_info().get_libmode_for(l);
+               BuildInfo::LibraryMode libmode = binfo.get_libmode_for(l);
                Target *lib = builder.get_vfs().find_library(l, binfo.libpath, libmode);
                if(lib)
                {