X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fobjectfile.cpp;h=732fe142400f72159f2f800407c16d6287fce10d;hb=3f0f7216789aeedba206308c452623351e406e75;hp=7208f424bd1b001493cec14420df2d92bf7c4fae;hpb=df88e22a258f169b9505acb0cb8d0ba7e66af7b6;p=builder.git diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 7208f42..732fe14 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -20,7 +20,12 @@ ObjectFile::ObjectFile(Builder &b, const Component &c, SourceFile &s): FS::Path ObjectFile::generate_target_path(const Component &comp, const FS::Path &src) { const SourcePackage &pkg = comp.get_package(); - FS::Path rel_src = FS::relative(src, pkg.get_source_directory()).str(); + FS::Path temp_dir = pkg.get_temp_directory()/comp.get_name(); + FS::Path rel_src; + if(FS::descendant_depth(src, temp_dir)>=0) + rel_src = FS::relative(src, temp_dir); + else + rel_src = FS::relative(src, pkg.get_source_directory()); string fn; for(FS::Path::Iterator i=rel_src.begin(); i!=rel_src.end(); ++i) { @@ -29,7 +34,13 @@ FS::Path ObjectFile::generate_target_path(const Component &comp, const FS::Path if(*i!=".") fn += *i; } - return pkg.get_temp_directory()/comp.get_name()/(FS::basepart(fn)+".o"); + return temp_dir/(FS::basepart(fn)+".o"); +} + +void ObjectFile::collect_build_info(BuildInfo &binfo) const +{ + Target::collect_build_info(binfo); + binfo.update_from(component->get_build_info_for_path(source.get_path())); } void ObjectFile::find_dependencies()