]> git.tdb.fi Git - builder.git/blobdiff - source/lib/binary.cpp
Optimize Binary::collect_build_info
[builder.git] / source / lib / binary.cpp
index f245037b6b24abe35662b46ab04219dad5de7e7f..9d73785911d806c9ff5746403b66b271990219a5 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);