X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=plugins%2Fmsvc%2Fmsvclinker.cpp;h=ca77a28edddfb14d6920f910fd85d57f5bb89c0e;hb=c5d6d6d6d76189b9b2937295709b85654780e9db;hp=8008791569a37d2c57816d0e68a8199b6124eddf;hpb=c8e829c219c65ff8e93b6c7b66212ff0876441c5;p=builder.git diff --git a/plugins/msvc/msvclinker.cpp b/plugins/msvc/msvclinker.cpp index 8008791..ca77a28 100644 --- a/plugins/msvc/msvclinker.cpp +++ b/plugins/msvc/msvclinker.cpp @@ -19,8 +19,8 @@ MsvcLinker::MsvcLinker(Builder &b, const Architecture &a, const MicrosoftTools & Tool(b, &a, "LINK"), ms_tools(m) { - input_suffixes.push_back(".o"); - input_suffixes.push_back(".a"); + input_suffixes.push_back(".obj"); + input_suffixes.push_back(".lib"); processing_unit = COMPONENT; @@ -94,8 +94,13 @@ ExternalTask::Arguments MsvcLinker::_run(const Binary &bin, FS::Path &work_dir) argv.push_back(tool.get_executable()->get_path().str()); argv.push_back("/NOLOGO"); - if(dynamic_cast(&bin)) + string imp_fn; + if(const SharedLibrary *shlib = dynamic_cast(&bin)) + { argv.push_back("/DLL"); + if(const ImportLibrary *imp = shlib->get_import_library()) + imp_fn = relative(imp->get_path(), work_dir).str(); + } BuildInfo binfo; bin.collect_build_info(binfo); @@ -108,6 +113,10 @@ ExternalTask::Arguments MsvcLinker::_run(const Binary &bin, FS::Path &work_dir) argv.push_back("/DEBUG:FULL"); argv.push_back("/OUT:"+relative(bin.get_path(), work_dir).str()); + if(!imp_fn.empty()) + argv.push_back("/IMPLIB:"+imp_fn); + else + argv.push_back("/NOIMPLIB"); for(Target *d: bin.get_dependencies()) {