void VsSolutionFile::find_dependencies()
{
- if(FileTarget *project = builder.get_vfs().get_target(package->get_source_directory()/(package->get_name()+".vcxproj")))
- add_dependency(*project);
+ find_dependencies(*package);
+}
- Package::Requirements reqs = package->get_required_packages();
- for(auto i=reqs.begin(); i!=reqs.end(); ++i)
- if(const SourcePackage *spkg = dynamic_cast<const SourcePackage *>(*i))
+void VsSolutionFile::find_dependencies(const SourcePackage &spkg)
+{
+ if(FileTarget *project = builder.get_vfs().get_target(spkg.get_source_directory()/(spkg.get_name()+".vcxproj")))
+ if(!any_equals(depends, static_cast<Target *>(project)))
{
- if(FileTarget *project = builder.get_vfs().get_target(spkg->get_source_directory()/(spkg->get_name()+".vcxproj")))
- add_dependency(*project);
+ add_dependency(*project);
- for(Package *r: spkg->get_required_packages())
- if(!any_equals(reqs, r))
- reqs.push_back(r);
+ for(const Package *r: spkg.get_required_packages())
+ if(const SourcePackage *s = dynamic_cast<const SourcePackage *>(r))
+ find_dependencies(*s);
}
}