X-Git-Url: http://git.tdb.fi/?p=builder.git;a=blobdiff_plain;f=source%2Flib%2Fobjectfile.cpp;fp=source%2Flib%2Fobjectfile.cpp;h=63a8e6b2b7c44a61c6699b71eb7f5d94e5ac2862;hp=65ad4330cb740b6ecc57e7f9fd4f8b3783e93399;hb=fa77f807be7a92e655befa2c344128d2dadd788f;hpb=cb7570b1cc8364481550eca1447cd6a140b31aa7 diff --git a/source/lib/objectfile.cpp b/source/lib/objectfile.cpp index 65ad433..63a8e6b 100644 --- a/source/lib/objectfile.cpp +++ b/source/lib/objectfile.cpp @@ -19,23 +19,9 @@ 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 temp_dir = pkg.get_temp_directory(); - 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(const string &c: rel_src) - { - if(!fn.empty()) - fn += '_'; - if(c!=".") - fn += c; - } + string fn = comp.flatten_source_path(src); const Architecture &arch = comp.get_package().get_builder().get_current_arch(); - return temp_dir/comp.get_name()/arch.create_filename(FS::basepart(fn)); + return comp.get_temp_directory()/arch.create_filename(FS::basepart(fn)); } void ObjectFile::set_used_in_shared_library(bool u)