]> git.tdb.fi Git - builder.git/commitdiff
Also store library path in static libraries
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2018 15:25:19 +0000 (18:25 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2018 15:25:19 +0000 (18:25 +0300)
source/binarypackage.cpp
source/staticlibrary.cpp
source/staticlibrary.h

index bed4c90b9875e63331f6676ab51ade95b767977e..5415f257ef180cf17953e525123a9119e5168a03 100644 (file)
@@ -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<StaticLibrary *>(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);
                                }
        }
 }
index 5ff84770021f4b67af5b64e0c505f14f7e586a62..be88b41bf31d61a34257ea75bfc726df4dca5adf 100644 (file)
@@ -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);
index c76b314cd441021cbffc99c8ee968eb4d69b7e42..26d33e350b5354ff641f95842c84703f71ad96e5 100644 (file)
@@ -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;
 };