X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmsvclinker.cpp;h=9352c0f51414626118c4a3a5fb857a9d92917fb8;hb=edd4771292a2273080fbcbac266c6831834b0b86;hp=f802ef63e454d714cc4a90fe4341997ab87b1726;hpb=7780df0b9a760327a9ad9ff80fc6b5d9a273db96;p=builder.git diff --git a/source/msvclinker.cpp b/source/msvclinker.cpp index f802ef6..9352c0f 100644 --- a/source/msvclinker.cpp +++ b/source/msvclinker.cpp @@ -4,7 +4,6 @@ #include "builder.h" #include "component.h" #include "executable.h" -#include "externaltask.h" #include "importlibrary.h" #include "microsofttools.h" #include "msvclinker.h" @@ -26,7 +25,7 @@ MsvcLinker::MsvcLinker(Builder &b, const Architecture &a, const MicrosoftTools & processing_unit = COMPONENT; set_command((ms_tools.get_vc_bin_dir()/"link.exe").str(), false); - set_run(_run); + set_run_external(_run); } Target *MsvcLinker::create_target(const vector &sources, const string &arg) @@ -63,29 +62,31 @@ string MsvcLinker::create_build_signature(const BuildInfo &binfo) const return result; } -void MsvcLinker::do_prepare() +void MsvcLinker::do_prepare(ToolData &tool) const { - string arch_dir = (architecture->get_bits()==64 ? "x64" : "x86"); + const std::string &tool_tag = static_cast(tool).get_tag(); + const Architecture &arch = *static_cast(tool).get_architecture(); + string arch_dir = (arch.get_bits()==64 ? "x64" : "x86"); const FS::Path &vc_base_dir = ms_tools.get_vc_base_dir(); - system_path.push_back(vc_base_dir/"lib"/arch_dir); + tool.system_path.push_back(vc_base_dir/"lib"/arch_dir); const FS::Path &win_sdk_dir = ms_tools.get_windows_sdk_dir(); const string &win_sdk_ver = ms_tools.get_windows_sdk_version(); - system_path.push_back(win_sdk_dir/"lib"/win_sdk_ver/"ucrt"/arch_dir); - system_path.push_back(win_sdk_dir/"lib"/win_sdk_ver/"um"/arch_dir); + tool.system_path.push_back(win_sdk_dir/"lib"/win_sdk_ver/"ucrt"/arch_dir); + tool.system_path.push_back(win_sdk_dir/"lib"/win_sdk_ver/"um"/arch_dir); string path; - for(const FS::Path &p: system_path) + for(const FS::Path &p: tool.system_path) { append(path, ";", p.str()); - builder.get_logger().log("tools", "Got %s system path: %s", tag, p); + builder.get_logger().log("tools", "Got %s system path: %s", tool_tag, p); } setenv("LIB", path); } -Task *MsvcLinker::_run(const Binary &bin) +ExternalTask::Arguments MsvcLinker::_run(const Binary &bin, FS::Path &work_dir) { const Tool &tool = *bin.get_tool(); @@ -93,8 +94,6 @@ Task *MsvcLinker::_run(const Binary &bin) 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(); - if(dynamic_cast(&bin)) argv.push_back("/DLL"); @@ -125,5 +124,5 @@ Task *MsvcLinker::_run(const Binary &bin) argv.push_back("/SUBSYSTEM:CONSOLE"); - return new ExternalTask(argv, work_dir); + return argv; }