X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnulinker.cpp;h=32f2bf3bb1843c72b3d4249541bccfcd8359eb55;hb=f75a99316e896cf1e424a489ce360a67844d86b0;hp=6eef8b3268da567f17385307e5c3022825fcd68a;hpb=37ffa892c453a91f06d34068e239e1ba316d7700;p=builder.git diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 6eef8b3..32f2bf3 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -7,7 +7,7 @@ #include "component.h" #include "executable.h" #include "externaltask.h" -#include "gnucxxcompiler.h" +#include "gnucompiler.h" #include "gnulinker.h" #include "objectfile.h" #include "sharedlibrary.h" @@ -83,12 +83,20 @@ Task *GnuLinker::run(const Target &) const GnuLinker::Linker::Linker(GnuLinker &p, const string &compiler_tag): SubTool(p) { - if(compiler_tag=="CC") - command = "gcc"; - else if(compiler_tag=="CXX") - command = "g++"; + const Tool &compiler = builder.get_toolchain().get_tool(compiler_tag); + if(dynamic_cast(&compiler)) + executable = compiler.get_executable(); else - throw invalid_argument("GnuLinker::Linker::Linker"); + { + string command; + if(compiler_tag=="CC") + command = "gcc"; + else if(compiler_tag=="CXX") + command = "g++"; + else + throw invalid_argument("GnuLinker::Linker::Linker"); + executable = builder.get_vfs().find_binary(command); + } } Target *GnuLinker::Linker::create_target(const list &sources, const string &arg) const @@ -101,7 +109,7 @@ Task *GnuLinker::Linker::run(const Target &target) const const Binary &bin = dynamic_cast(target); vector argv; - argv.push_back(command); + argv.push_back(executable->get_path().str()); const Component &comp = *bin.get_component();