X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstallcomponent.cpp;h=319053f0ba42bbfbbf7c27fc0a112a63b2d6ac75;hb=82c7d6187fdaeaa1b9cfbd6637d9b047a78f17ec;hp=9584a515781ce0c351ffec498b194c9b3d31b563;hpb=35f2979869bff43706f3163ec0979c7084aaa3c4;p=builder.git diff --git a/source/installcomponent.cpp b/source/installcomponent.cpp index 9584a51..319053f 100644 --- a/source/installcomponent.cpp +++ b/source/installcomponent.cpp @@ -5,6 +5,7 @@ #include "tool.h" using namespace std; +using namespace Msp; InstallComponent::InstallComponent(SourcePackage &p, const string &n): Component(p, n) @@ -16,14 +17,11 @@ void InstallComponent::create_targets() const Target *inst = builder.get_build_graph().get_target("install"); Tool © = builder.get_toolchain().get_tool("CP"); - SourceList source_filenames = collect_source_files(); - for(SourceList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) + for(const FS::Path &s: collect_source_files()) { - FileTarget *ft; - if(Target *tgt = builder.get_vfs().get_target(*i)) - ft = dynamic_cast(tgt); - else - ft = new File(builder, package, *i); - inst->add_dependency(*copy.create_target(*ft, name)); + Target *tgt = builder.get_vfs().get_target(s); + if(!tgt) + tgt = new File(builder, package, s); + inst->add_dependency(*copy.create_target(*tgt, name)); } }