throw invalid_argument("MsvcCompiler::MsvcCompiler");
set_command((ms_tools.get_vc_bin_dir()/"cl.exe").str(), false);
+ set_run(_run);
}
Target *MsvcCompiler::create_source(const Component &comp, const FS::Path &path) const
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("INCLUDE", path);
}
-Task *MsvcCompiler::run(const Target &target) const
+Task *MsvcCompiler::_run(const ObjectFile &object)
{
- const ObjectFile &object = dynamic_cast<const ObjectFile &>(target);
+ const Tool &tool = *object.get_tool();
ExternalTask::Arguments argv;
- argv.push_back(executable->get_path().str());
+ argv.push_back(tool.get_executable()->get_path().str());
argv.push_back("/nologo");
argv.push_back("/c");
BuildInfo binfo;
- target.collect_build_info(binfo);
+ object.collect_build_info(binfo);
- if(binfo.standards.count(tag))
+ if(binfo.standards.count(tool.get_tag()))
{
- const BuildInfo::LanguageStandard &std = get_item(binfo.standards, tag);
- if((tag=="CXX" && std.year>2011) || (tag=="CC" && std.year>1999))
+ const BuildInfo::LanguageStandard &std = get_item(binfo.standards, tool.get_tag());
+ if((tool.get_tag()=="CXX" && std.year>2011) || (tool.get_tag()=="CC" && std.year>1999))
argv.push_back("/std:"+std.str());
}