From: Mikko Rasa Date: Sun, 8 Jul 2018 15:25:19 +0000 (+0300) Subject: Also store library path in static libraries X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ba75b70d983e1af41cd96a9d95d03e03a0edbc00;p=builder.git Also store library path in static libraries --- diff --git a/source/binarypackage.cpp b/source/binarypackage.cpp index bed4c90..5415f25 100644 --- a/source/binarypackage.cpp +++ b/source/binarypackage.cpp @@ -97,12 +97,17 @@ void BinaryPackage::do_prepare() if(!static_binfo.libs.empty()) { + BuildInfo::PathList combined_libpath = static_binfo.libpath; + combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end()); + for(BuildInfo::WordList::const_iterator i=export_binfo.libs.begin(); i!=export_binfo.libs.end(); ++i) if(Target *lib = builder.get_vfs().find_library(*i, export_binfo.libpath, BuildInfo::FORCE_STATIC, system)) if(StaticLibrary *stlib = dynamic_cast(lib)) { for(BuildInfo::WordList::const_iterator j=static_binfo.libs.begin(); j!=static_binfo.libs.end(); ++j) stlib->add_required_library(*j); + for(BuildInfo::PathList::const_iterator j=combined_libpath.begin(); j!=combined_libpath.end(); ++j) + stlib->add_library_path(*j); } } } diff --git a/source/staticlibrary.cpp b/source/staticlibrary.cpp index 5ff8477..be88b41 100644 --- a/source/staticlibrary.cpp +++ b/source/staticlibrary.cpp @@ -34,6 +34,11 @@ void StaticLibrary::add_required_library(const string &lib) build_info.libs.push_back(lib); } +void StaticLibrary::add_library_path(const FS::Path &pth) +{ + build_info.libpath.push_back(pth); +} + void StaticLibrary::collect_build_info(BuildInfo &binfo) const { Target::collect_build_info(binfo); diff --git a/source/staticlibrary.h b/source/staticlibrary.h index c76b314..26d33e3 100644 --- a/source/staticlibrary.h +++ b/source/staticlibrary.h @@ -27,6 +27,7 @@ public: virtual const char *get_type() const { return "StaticLibrary"; } void add_required_library(const std::string &); + void add_library_path(const Msp::FS::Path &); virtual void collect_build_info(BuildInfo &) const; };