]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Add support for building datafiles
[builder.git] / source / component.cpp
index de42d922404f995a186e80a6e62c5819faa59746..26ce71058dfd79edf38b5006e2d5620cd82261b3 100644 (file)
@@ -13,6 +13,7 @@ Distributed under the LGPL
 #include <msp/strings/lexicalcast.h>
 #include "builder.h"
 #include "component.h"
+#include "datafile.h"
 #include "executable.h"
 #include "file.h"
 #include "header.h"
@@ -136,6 +137,16 @@ void Component::create_targets() const
                        inst_list.push_back(ft);
                }
        }
+       else if(type==DATAFILE)
+       {
+               File *source;
+               if(Target *tgt=builder.get_target(files.front().str()))
+                       source=dynamic_cast<File *>(tgt);
+               else
+                       source=new File(builder, pkg, files.front());
+               ::DataFile *result=new ::DataFile(builder, *this, *source);
+               inst_list.push_back(result);
+       }
        else
        {
                for(PathList::const_iterator i=files.begin(); i!=files.end(); ++i)