From: Mikko Rasa Date: Fri, 5 May 2023 21:38:16 +0000 (+0300) Subject: Only displace dependencies from the same component X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=f6f82237414beafa383c756af8c2f27ef44f1a53;p=builder.git 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. --- 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());