X-Git-Url: http://git.tdb.fi/?p=builder.git;a=blobdiff_plain;f=source%2Finstallcomponent.cpp;h=ed3c191cd7769a1cb95ca77d5f2fb99adab9a41d;hp=9584a515781ce0c351ffec498b194c9b3d31b563;hb=276a7c7c046a8f1b692cecbd53f17595ed23264d;hpb=658c46ea8ef6d7022cb8c8e06565ebce12842d0b diff --git a/source/installcomponent.cpp b/source/installcomponent.cpp index 9584a51..ed3c191 100644 --- a/source/installcomponent.cpp +++ b/source/installcomponent.cpp @@ -19,11 +19,9 @@ void InstallComponent::create_targets() const SourceList source_filenames = collect_source_files(); for(SourceList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) { - 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(*i); + if(!tgt) + tgt = new File(builder, package, *i); + inst->add_dependency(*copy.create_target(*tgt, name)); } }