X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Flib%2Fcomponent.cpp;fp=source%2Flib%2Fcomponent.cpp;h=1ba258bd70a00f4011587bd3617ccff24796a7ce;hb=6ce67e1469bf62156ddf64e33644851f9064c6ed;hp=c12a5a8c604916a3777d8a783afe976b4e90177a;hpb=17783446dddb1a60c5174031c97b13e4d1bc1f8e;p=builder.git diff --git a/source/lib/component.cpp b/source/lib/component.cpp index c12a5a8..1ba258b 100644 --- a/source/lib/component.cpp +++ b/source/lib/component.cpp @@ -20,6 +20,21 @@ void Component::prepare() broken |= r->is_broken(); } + if(!sources.empty()) + { + for(auto i=sources.begin(); i!=sources.end(); ++i) + { + FS::Path s = *i; + if(!FS::is_dir(s)) + s = FS::dirname(s); + + if(i==sources.begin()) + source_base_path = s; + else + source_base_path = FS::common_ancestor(source_base_path, s); + } + } + if(!problems.empty()) broken = true; } @@ -77,7 +92,7 @@ string Component::flatten_source_path(const FS::Path &source) const if(FS::descendant_depth(source, temp_dir)>=0) rel_src = FS::relative(source, temp_dir); else - rel_src = FS::relative(source, package.get_source_directory()); + rel_src = FS::relative(source, source_base_path); string fn; for(const string &c: rel_src)