]> git.tdb.fi Git - builder.git/blobdiff - source/gnulinker.cpp
Clean up compiler and linker constructors
[builder.git] / source / gnulinker.cpp
index adc3efcfcf6ad72d933b8e401836cbd935e34091..faa62024e250aee1414caab7f52aed7ed794ebe8 100644 (file)
@@ -21,7 +21,7 @@
 using namespace std;
 using namespace Msp;
 
-GnuLinker::GnuLinker(Builder &b, const Architecture &a, const FS::Path &sysroot):
+GnuLinker::GnuLinker(Builder &b, const Architecture &a):
        Tool(b, a, "LINK")
 {
        input_suffixes.push_back(".o");
@@ -29,9 +29,6 @@ GnuLinker::GnuLinker(Builder &b, const Architecture &a, const FS::Path &sysroot)
 
        processing_unit = COMPONENT;
 
-       if(!sysroot.empty())
-               build_info.sysroot = sysroot;
-
        default_linker = new Linker(*this, "CC");
        cxx_linker = new Linker(*this, "CXX");
 }
@@ -220,6 +217,10 @@ string GnuLinker::Linker::create_build_signature(const BuildInfo &binfo) const
 
 void GnuLinker::Linker::do_prepare()
 {
+       parent.prepare();
+       build_info = parent.get_build_info();
+       system_path = parent.get_system_path();
+
        Tool &compiler = builder.get_toolchain().get_tool(compiler_tag);
        if(dynamic_cast<GnuCompiler *>(&compiler))
        {