]> git.tdb.fi Git - builder.git/blobdiff - source/installcomponent.cpp
Inline simple constructors
[builder.git] / source / installcomponent.cpp
index 9584a515781ce0c351ffec498b194c9b3d31b563..86919fa3255ca484f760fd9fb6013d5a2e8686a4 100644 (file)
@@ -5,10 +5,7 @@
 #include "tool.h"
 
 using namespace std;
-
-InstallComponent::InstallComponent(SourcePackage &p, const string &n):
-       Component(p, n)
-{ }
+using namespace Msp;
 
 void InstallComponent::create_targets() const
 {
@@ -16,14 +13,11 @@ void InstallComponent::create_targets() const
        Target *inst = builder.get_build_graph().get_target("install");
        Tool &copy = 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<FileTarget *>(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));
        }
 }