X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmsvccompiler.cpp;h=099c1230b7e5e18518c429dd7bc3f865180ea9c8;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=c676790eb4fddbb126c16fad464f310dafbb9233;hpb=7c2db9e2b91da953701be233336c5bfa1f3c4af0;p=builder.git diff --git a/source/msvccompiler.cpp b/source/msvccompiler.cpp index c676790..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 @@ -46,7 +47,7 @@ Target *MsvcCompiler::create_source(const FS::Path &path) const return new CSourceFile(builder, path); } -Target *MsvcCompiler::create_target(const list &sources, const string &) +Target *MsvcCompiler::create_target(const vector &sources, const string &) { if(sources.size()!=1) throw invalid_argument("MsvcCompiler::create_target"); @@ -58,7 +59,7 @@ Target *MsvcCompiler::create_target(const list &sources, const string string MsvcCompiler::create_build_signature(const BuildInfo &binfo) const { - string result = FS::basename(executable->get_path()); + string result = Tool::create_build_signature(binfo); result += ','; if(binfo.debug) result += 'g'; @@ -87,28 +88,28 @@ void MsvcCompiler::do_prepare() 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(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()); }