From f6f82237414beafa383c756af8c2f27ef44f1a53 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 6 May 2023 00:38:16 +0300 Subject: [PATCH] Only displace dependencies from the same component Now that files can be installed into a private staging directory, there's little reason to include headers from a different component directly. --- source/lib/filetarget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/lib/filetarget.cpp b/source/lib/filetarget.cpp index 570f5f4..33458cc 100644 --- a/source/lib/filetarget.cpp +++ b/source/lib/filetarget.cpp @@ -71,14 +71,13 @@ Target *FileTarget::resolve_transitive_dependency(Target &from, Target &dep) con if(!from_file || !dep_file) return &dep; - const SourcePackage *from_pkg = from.get_package(); - if(dep_file->get_package()!=from_pkg || FS::descendant_depth(dep_file->get_path(), from_pkg->get_source_directory())<0) + const Component *from_comp = from_file->get_real_target()->get_component(); + const Component *dep_comp = dep_file->get_component(); + if(dep_comp!=from_comp) return &dep; /* Adjust the path of the dependency to account for the install location of the dependent target. */ - const Component *from_comp = from_file->get_real_target()->get_component(); - const Component *dep_comp = dep_file->get_component(); FS::Path from_inst = from_comp->get_install_map().get_install_location(*from_file->get_real_target()); FS::Path dep_inst = dep_comp->get_install_map().get_install_location(*dep_file); FS::Path displaced = FS::dirname(from_file->get_path())/FS::relative(dep_inst, from_inst)/FS::basename(dep_file->get_path()); -- 2.45.2