]> git.tdb.fi Git - builder.git/commitdiff
Only displace dependencies from the same component
authorMikko Rasa <tdb@tdb.fi>
Fri, 5 May 2023 21:38:16 +0000 (00:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 5 May 2023 21:38:16 +0000 (00:38 +0300)
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

index 570f5f499ec22b1e957c526515f3ad4dfd1fe3ef..33458cce44da6d174e2e9d11ecb458b18558994f 100644 (file)
@@ -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());