From: Mikko Rasa Date: Sun, 21 Feb 2021 20:00:48 +0000 (+0200) Subject: Account for install directories when forming displaced dependency paths X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e4c839cacd8572ade951f4961e8e145d20e0103f;p=builder.git Account for install directories when forming displaced dependency paths --- diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 0536755..f413ad4 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -71,6 +71,7 @@ void ObjectFile::find_dependencies(FileTarget *tgt) } else { + FS::Path inst_dir = rtgt->get_component()->get_install_map().get_install_location(*rtgt); /* The target has been displaced by installing it. Displace any dependencies that come from the same package as well. */ const SourcePackage *tpkg = rtgt->get_package(); @@ -79,12 +80,13 @@ void ObjectFile::find_dependencies(FileTarget *tgt) FileTarget *file = dynamic_cast(*i); if(file && file->get_package()==tpkg && FS::descendant_depth(file->get_path(), tpkg->get_source_directory())>=0) { - FS::Path displaced = tgt->get_path()/FS::relative(file->get_path(), rtgt->get_path()); + const Component *tcomp = file->get_component(); + FS::Path dep_inst = tcomp->get_install_map().get_install_location(*file); + FS::Path displaced = FS::dirname(tgt->get_path())/FS::relative(dep_inst, inst_dir)/FS::basename(file->get_path()); if(Target *ddep = builder.get_vfs().get_target(displaced)) deps_to_add.push_back(ddep); else { - const Component *tcomp = file->get_component(); const Component::OverlayList &overlays = tcomp->get_overlays(); string last_dir = FS::basename(FS::dirname(displaced)); for(Component::OverlayList::const_iterator j=overlays.begin(); j!=overlays.end(); ++j)