X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flink.cpp;h=8b4c56421089e34d8bee43ffbd378c28cfb1566d;hb=4fcc283a4bb1f695bd124006906bcdaba053193f;hp=e2c0f1222a83cb9d7baea296f8fcda4da17c0130;hpb=0d80cabf649b931b26e7055385156c75a7385d35;p=builder.git diff --git a/source/link.cpp b/source/link.cpp index e2c0f12..8b4c564 100644 --- a/source/link.cpp +++ b/source/link.cpp @@ -1,15 +1,19 @@ #include +#include "builder.h" #include "component.h" #include "executable.h" #include "link.h" +#include "objectfile.h" #include "package.h" using namespace std; using namespace Msp; -Link::Link(Builder &b, const Executable &exe, const Component &comp): +Link::Link(Builder &b, const Executable &exe): ExternalAction(b) { + const Component &comp=exe.get_component(); + argv.push_back("g++"); if(comp.get_type()==Component::LIBRARY) @@ -27,10 +31,12 @@ Link::Link(Builder &b, const Executable &exe, const Component &comp): argv.push_back(exe.get_name()); const list &deps=exe.get_depends(); for(list::const_iterator i=deps.begin(); i!=deps.end(); ++i) - argv.push_back((*i)->get_name()); + if(dynamic_cast(*i)) + argv.push_back((*i)->get_name()); Path::Path epath=exe.get_name(); - Path::mkpath(epath.subpath(0, epath.size()-1), 0755); + if(!builder.get_dry_run()) + Path::mkpath(epath.subpath(0, epath.size()-1), 0755); announce(comp.get_package().get_name(), "LINK", relative(epath, comp.get_package().get_source()).str());