]> git.tdb.fi Git - builder.git/blobdiff - source/gnulinker.cpp
Refactor the use of external tasks in tools
[builder.git] / source / gnulinker.cpp
index dacd54d5b1649e7b08fd7bc0885895df0dbcd3a1..b726dd5846cb6ed228955adfe3d7a73510d0ff96 100644 (file)
@@ -9,7 +9,6 @@
 #include "component.h"
 #include "executable.h"
 #include "exportdefinitions.h"
-#include "externaltask.h"
 #include "gnucompiler.h"
 #include "gnulinker.h"
 #include "importlibrary.h"
@@ -31,7 +30,7 @@ GnuLinker::GnuLinker(Builder &b, const Architecture &a):
        processing_unit = COMPONENT;
 
        set_command("gcc", true);
-       set_run(_run);
+       set_run_external(_run);
 }
 
 Target *GnuLinker::create_target(const vector<Target *> &sources, const string &arg)
@@ -199,7 +198,7 @@ void GnuLinker::do_prepare(ToolData &tool) const
        }
 }
 
-Task *GnuLinker::_run(const Binary &bin)
+ExternalTask::Arguments GnuLinker::_run(const Binary &bin, FS::Path &work_dir)
 {
        const Tool &tool = *bin.get_tool();
        const Builder &builder = tool.get_builder();
@@ -208,8 +207,6 @@ Task *GnuLinker::_run(const Binary &bin)
        ExternalTask::Arguments argv;
        argv.push_back(tool.get_executable()->get_path().str());
 
-       FS::Path work_dir = bin.get_component()->get_package().get_source_directory();
-
        if(const SharedLibrary *shlib = dynamic_cast<const SharedLibrary *>(&bin))
        {
                argv.push_back("-shared");
@@ -324,5 +321,5 @@ Task *GnuLinker::_run(const Binary &bin)
                        argv.push_back("-Wl,--enable-auto-import");
        }
 
-       return new ExternalTask(argv, work_dir);
+       return argv;
 }