X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmsvccompiler.cpp;h=099c1230b7e5e18518c429dd7bc3f865180ea9c8;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=dbbc64d41895baea735e41d2e7f8f5c19ec8dd59;hpb=2a23a19ff6717b32ddc45f84681c5c969c967e45;p=builder.git diff --git a/source/msvccompiler.cpp b/source/msvccompiler.cpp index dbbc64d..099c123 100644 --- a/source/msvccompiler.cpp +++ b/source/msvccompiler.cpp @@ -34,6 +34,7 @@ MsvcCompiler::MsvcCompiler(Builder &b, const Architecture &a, const string &t, c 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 @@ -93,22 +94,22 @@ void MsvcCompiler::do_prepare() setenv("INCLUDE", path); } -Task *MsvcCompiler::run(const Target &target) const +Task *MsvcCompiler::_run(const ObjectFile &object) { - const ObjectFile &object = dynamic_cast(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()); }