+ /* Add default entries to paths if they're empty and the package was found
+ in a non-system location */
+ if(!system && export_binfo.incpath.empty())
+ export_binfo.incpath.push_back(base_path/"include");
+ if(!system && export_binfo.libpath.empty())
+ export_binfo.libpath.push_back(base_path/"lib");
+
+ if(has_relative_paths)
+ {
+ for(FS::Path &p: export_binfo.incpath)
+ p = base_path/p;
+ for(FS::Path &p: export_binfo.libpath)
+ p = base_path/p;
+ }
+
+ if(!static_binfo.libs.empty())
+ {
+ VirtualFileSystem::SearchPath combined_libpath = static_binfo.libpath;
+ combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end());
+
+ for(const string &l: export_binfo.libs)
+ if(Target *lib = builder.get_vfs().find_library(l, export_binfo.libpath, BuildInfo::FORCE_STATIC, system))
+ if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(lib))
+ {
+ for(const string &s: static_binfo.libs)
+ stlib->add_required_library(s);
+ for(const FS::Path &p: combined_libpath)
+ stlib->add_library_path(p);
+ }
+ }