#include <msp/core/environ.h>
#include <msp/fs/utils.h>
-#include <msp/strings/format.h>
#include <msp/strings/utils.h>
#include "builder.h"
#include "component.h"
processing_unit = COMPONENT;
set_command((ms_tools.get_vc_bin_dir()/"link.exe").str(), false);
+ set_run(_run);
}
Target *MsvcLinker::create_target(const vector<Target *> &sources, const string &arg)
for(const FS::Path &p: system_path)
{
append(path, ";", p.str());
- builder.get_logger().log("tools", format("Got %s system path: %s", tag, p));
+ builder.get_logger().log("tools", "Got %s system path: %s", tag, p);
}
setenv("LIB", path);
}
-Task *MsvcLinker::run(const Target &target) const
+Task *MsvcLinker::_run(const Binary &bin)
{
- const Binary &bin = dynamic_cast<const Binary &>(target);
+ const Tool &tool = *bin.get_tool();
vector<string> argv;
- argv.push_back(executable->get_path().str());
+ argv.push_back(tool.get_executable()->get_path().str());
argv.push_back("/NOLOGO");
FS::Path work_dir = bin.get_component()->get_package().get_source_directory();
argv.push_back("/DLL");
BuildInfo binfo;
- target.collect_build_info(binfo);
+ bin.collect_build_info(binfo);
/*for(const FS::Path &p: binfo.libpath)
argv.push_back("/LIBPATH:"+p.str());*/
argv.push_back("/OUT:"+relative(bin.get_path(), work_dir).str());
- for(Target *d: target.get_dependencies())
+ for(Target *d: bin.get_dependencies())
{
FileTarget *file = dynamic_cast<FileTarget *>(d);
Target *tgt = d->get_real_target();