X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinary.cpp;h=ff98644ec53a6711ed3e63910a0876bd6447dc40;hb=632361796a7ddadf8a726526c937fab22281fb7b;hp=4728cd19e2ee410698d0b6c86ad8fb29d1b0da79;hpb=bd2a50ecb9f582c6e9569ffc9f33d41f10363c5f;p=builder.git diff --git a/source/binary.cpp b/source/binary.cpp index 4728cd1..ff98644 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -3,34 +3,36 @@ #include "binary.h" #include "builder.h" #include "component.h" -#include "install.h" #include "link.h" #include "objectfile.h" -#include "package.h" #include "sharedlibrary.h" +#include "sourcepackage.h" #include "staticlibrary.h" using namespace std; using namespace Msp; Binary::Binary(Builder &b, const Component &c, const list &objs): - FileTarget(b, &c.get_package(), generate_target_path(c)), - comp(c) + FileTarget(b, &c.get_package(), generate_target_path(c)) { - buildable = true; + component = &c; for(list::const_iterator i=objs.begin(); i!=objs.end(); ++i) add_depend(*i); } void Binary::find_depends() { - LibMode libmode = comp.get_package().get_library_mode(); + if(!component) + return; + + const SourcePackage &spkg = component->get_package(); + LibMode libmode = spkg.get_library_mode(); if(dynamic_cast(this)) libmode = DYNAMIC; list queue; list dep_libs; - queue.push_back(&comp); + queue.push_back(component); while(!queue.empty()) { const Component *c = queue.front(); @@ -48,10 +50,10 @@ void Binary::find_depends() lib = lib->get_real_target(); if(StaticLibrary *stlib = dynamic_cast(lib)) - queue.push_back(&stlib->get_component()); + queue.push_back(stlib->get_component()); } else - builder.problem(comp.get_package().get_name(), format("Couldn't find library %s for %s", *i, name)); + builder.problem(spkg.get_name(), format("Couldn't find library %s for %s", *i, name)); } }