binfo.update_from(obj_tool->get_build_info());
Target::collect_build_info(binfo);
+
+ binfo.update_from(static_binfo);
}
void Binary::find_dependencies()
if(!component)
return;
- list<const Component *> queue;
+ list<Target *> queue;
list<Target *> dep_libs;
set<string> missing_libs;
- queue.push_back(component);
+ queue.push_back(this);
while(!queue.empty())
{
- queue.erase(queue.begin());
+ Target *tgt = queue.front();
+ queue.pop_front();
BuildInfo binfo;
- collect_build_info(binfo);
+ tgt->collect_build_info(binfo);
+ if(tgt!=this)
+ static_binfo.libpath.insert(static_binfo.libpath.end(), binfo.libpath.begin(), binfo.libpath.end());
for(BuildInfo::WordList::const_iterator i=binfo.libs.begin(); i!=binfo.libs.end(); ++i)
{
if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(real))
{
dep_libs.push_back(stlib);
- if(stlib->get_component())
- queue.push_back(stlib->get_component());
+ queue.push_back(stlib);
}
else
dep_libs.push_back(lib);
#ifndef BINARY_H_
#define BINARY_H_
+#include "buildinfo.h"
#include "filetarget.h"
class Component;
*/
class Binary: public FileTarget
{
+private:
+ BuildInfo static_binfo;
+
protected:
std::list<ObjectFile *> objects;
if(type==LIBRARY || type==MODULE)
if(build_info.libmode<BuildInfo::DYNAMIC)
build_info.libmode = BuildInfo::DYNAMIC;
-
- if(build_info.libmode<BuildInfo::DYNAMIC)
- {
- for(Package::Requirements::iterator i=all_reqs.begin(); i!=all_reqs.end(); ++i)
- {
- const BuildInfo &ebi = (*i)->get_exported_build_info();
- build_info.libpath.insert(build_info.libpath.end(), ebi.libpath.begin(), ebi.libpath.end());
- }
- }
}
BuildInfo Component::get_build_info_for_path(const FS::Path &path) const