#include <msp/fs/utils.h>
+#include <msp/strings/format.h>
#include "builder.h"
#include "executable.h"
#include "externaltask.h"
return primary;
}
-void SourceGenerator::do_prepare()
-{
- FS::Path exe_fn = package.get_source_directory()/command;
- executable = builder.get_vfs().get_target(exe_fn);
- if(!executable)
- executable = new Executable(builder, exe_fn);
-}
-
Task *SourceGenerator::run(const Target &target) const
{
const SourceFile &out_src = dynamic_cast<const SourceFile &>(target);
SourceGenerator::Loader::Loader(SourceGenerator &sg):
- DataFile::ObjectLoader<SourceGenerator>(sg)
+ DataFile::ObjectLoader<SourceGenerator>(sg),
+ ConditionalLoader(sg.package, format("%s/%s", sg.package.get_name(), sg.tag))
{
add("command", &Loader::command);
add("in_suffix", &Loader::in_suffix);
void SourceGenerator::Loader::command(const string &c)
{
- obj.set_command(c);
+ obj.set_command((obj.package.get_source_directory()/c).str());
}
void SourceGenerator::Loader::in_suffix(const string &s)