From: Mikko Rasa Date: Sun, 15 Jul 2012 17:29:35 +0000 (+0300) Subject: Refactor Binary::find_depends X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2992094d86385f06bf9c86bb1d35ad8fe857f257;p=builder.git Refactor Binary::find_depends --- diff --git a/source/binary.cpp b/source/binary.cpp index ed73169..0dcb62f 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -28,10 +28,7 @@ void Binary::find_depends() if(!component) return; - const SourcePackage &spkg = component->get_package(); BuildInfo::LibraryMode libmode = component->get_build_info().libmode; - if(dynamic_cast(this) && libmode queue; list dep_libs; @@ -41,12 +38,10 @@ void Binary::find_depends() const Component *c = queue.front(); queue.erase(queue.begin()); - const BuildInfo::PathList &libpath = c->get_build_info().libpath; - - const BuildInfo::WordList &libs = c->get_build_info().libs; - for(BuildInfo::WordList::const_iterator i=libs.begin(); i!=libs.end(); ++i) + const BuildInfo &binfo = c->get_build_info(); + for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i) { - Target *lib = builder.get_vfs().find_library(*i, libpath, libmode); + Target *lib = builder.get_vfs().find_library(*i, binfo.libpath, libmode); if(lib) { dep_libs.push_back(lib); @@ -57,7 +52,7 @@ void Binary::find_depends() queue.push_back(stlib->get_component()); } else - builder.problem(spkg.get_name(), format("Couldn't find library %s for %s", *i, name)); + builder.problem(package->get_name(), format("Couldn't find library %s for %s", *i, name)); } } diff --git a/source/component.cpp b/source/component.cpp index 72cdf78..9262af3 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -66,6 +66,10 @@ void Component::create_build_info() for(BuildInfo::PathList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i) *i = (pkg.get_source() / *i).str(); + if(type==LIBRARY || type==MODULE) + if(build_info.libmode