]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Move file-to-target mapping to a separate class
[builder.git] / source / component.cpp
index 24dce7739d47bb34c947312eaeacda44816fdab2..a7dfc34f7fff6091035e4c38cc2ec5c1fa150d45 100644 (file)
@@ -120,7 +120,7 @@ void Component::create_targets() const
                list<Target *> files;
                for(PathList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i)
                {
-                       FileTarget *file = builder.get_target_by_path(*i);
+                       FileTarget *file = builder.get_vfs().get_target(*i);
                        if(!file)
                                file = new File(builder, *i);
                        files.push_back(file);
@@ -149,7 +149,7 @@ void Component::create_targets() const
                for(PathList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i)
                {
                        FileTarget *ft;
-                       if(Target *tgt = builder.get_target_by_path(*i))
+                       if(Target *tgt = builder.get_vfs().get_target(*i))
                                ft = dynamic_cast<FileTarget *>(tgt);
                        else
                                ft = new File(builder, pkg, *i);
@@ -161,7 +161,7 @@ void Component::create_targets() const
                const Tool &dcomp = toolchain.get_tool("DATA");
 
                File *source;
-               if(Target *tgt = builder.get_target_by_path(source_filenames.front()))
+               if(Target *tgt = builder.get_vfs().get_target(source_filenames.front()))
                        source = dynamic_cast<File *>(tgt);
                else
                        source = new File(builder, pkg, source_filenames.front());
@@ -181,7 +181,7 @@ void Component::create_targets() const
                        string ext = FS::extpart(FS::basename(*i));
                        if(ext==".h")
                        {
-                               FileTarget *hdr = builder.get_target_by_path(*i);
+                               FileTarget *hdr = builder.get_vfs().get_target(*i);
                                if(!hdr)
                                        hdr = new Header(builder, *this, i->str());