]> git.tdb.fi Git - builder.git/blobdiff - source/msvccompiler.cpp
Refactor the use of external tasks in tools
[builder.git] / source / msvccompiler.cpp
index 7d751dea1882ecf2ea3cde2d946856c5768f10eb..56c99c33f4c096949b4b8ffd7c22ec82d324baec 100644 (file)
@@ -6,7 +6,6 @@
 #include "builder.h"
 #include "component.h"
 #include "csourcefile.h"
-#include "externaltask.h"
 #include "microsofttools.h"
 #include "msvccompiler.h"
 #include "objectfile.h"
@@ -34,7 +33,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);
+       set_run_external(_run);
 }
 
 Target *MsvcCompiler::create_source(const Component &comp, const FS::Path &path) const
@@ -96,7 +95,7 @@ void MsvcCompiler::do_prepare(ToolData &tool) const
        setenv("INCLUDE", path);
 }
 
-Task *MsvcCompiler::_run(const ObjectFile &object)
+ExternalTask::Arguments MsvcCompiler::_run(const ObjectFile &object, FS::Path &work_dir)
 {
        const Tool &tool = *object.get_tool();
 
@@ -174,10 +173,9 @@ Task *MsvcCompiler::_run(const ObjectFile &object)
 
        FS::Path obj_path = object.get_path();
        FS::Path src_path = object.get_source().get_path();
-       FS::Path work_dir = object.get_component()->get_package().get_source_directory();
 
        argv.push_back("/Fo"+relative(obj_path, work_dir).str());
        argv.push_back(relative(src_path, work_dir).str());
 
-       return new ExternalTask(argv, work_dir);
+       return argv;
 }