From: Mikko Rasa Date: Fri, 27 Jul 2012 07:52:20 +0000 (+0300) Subject: An include directory is needed as well X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=73b8ae52a68a9475834745cd8514562703103677;p=builder.git An include directory is needed as well --- diff --git a/source/component.cpp b/source/component.cpp index feb5094..8a57b64 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