+ vector<Target *> static_libs;
+ vector<Target *> shared_libs;
+ vector<string> missing_libs;
+ find_dependencies(this, static_libs, shared_libs, missing_libs);
+
+ for(Target *t: static_libs)
+ add_dependency(*t);
+ for(Target *t: shared_libs)
+ add_dependency(*t);
+ for(const string &m: missing_libs)
+ problems.push_back(format("Required library %s not found", m));
+}
+
+void Binary::find_dependencies(Target *tgt, vector<Target *> &static_libs, vector<Target *> &shared_libs, vector<string> &missing_libs)
+{
+ BuildInfo binfo;
+ tgt->collect_build_info(binfo);
+ if(tgt!=this)