X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcomponent.cpp;h=6bfce1fb6b8682f19c775552812b26af9da1b451;hb=fcb86bba9e8ea7e3c93f7f1748c0291b307c46ed;hp=feb5094b27a071fa8823eabd4e09c2fae466a11d;hpb=62ad932589407842cc1026af6e6d9f4012e60c67;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index feb5094..6bfce1f 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -68,6 +68,19 @@ void Component::create_build_info() final_build_info.update_from(build_info); build_info = final_build_info; + for(UseList::const_iterator i=uses.begin(); i!=uses.end(); ++i) + { + /* Select an include path that contains all the sources for this and the + used component. This should produce a sensible result in most cases. */ + FS::Path base; + for(SourceList::const_iterator j=sources.begin(); j!=sources.end(); ++j) + base = base.empty() ? *j : FS::common_ancestor(base, *j); + const SourceList &use_sources = (*i)->get_sources(); + for(SourceList::const_iterator j=use_sources.begin(); j!=use_sources.end(); ++j) + base = FS::common_ancestor(base, *j); + build_info.incpath.push_back(base); + } + if(type==LIBRARY || type==MODULE) if(build_info.libmode