- for(list<Target *>::iterator i=dep_libs.begin(); i!=dep_libs.end(); ++i)
- {
- bool last = true;
- for(list<Target *>::iterator j=i; (last && j!=dep_libs.end()); ++j)
- last = (j==i || *j!=*i);
- if(last)
- add_depend(*i);
- }
-
- deps_ready = true;
-}
-
-FS::Path Binary::generate_target_path(const Component &c)
-{
- const SourcePackage &pkg = c.get_package();
- string prefix, suffix;
- const string &sys = pkg.get_builder().get_current_arch().get_system();
-
- if(c.get_type()==Component::LIBRARY)
- {
- prefix = "lib";
- if(sys=="windows")
- suffix = ".dll";
- else
- suffix = ".so";
- }
- else if(c.get_type()==Component::MODULE)
- suffix = ".m";
- else if(c.get_type()==Component::PROGRAM)
- {
- if(sys=="windows")
- suffix = ".exe";
- }
-
- return pkg.get_out_dir()/(prefix+c.get_name()+suffix);
+ for(auto i=dep_libs.begin(); i!=dep_libs.end(); ++i)
+ if(!any_of(next(i), dep_libs.end(), [i](Target *d){ return d==*i; }))
+ add_dependency(**i);