]> git.tdb.fi Git - builder.git/blobdiff - source/binarypackage.cpp
Add logging for some problem situations
[builder.git] / source / binarypackage.cpp
index 679fb636132127ab39195a101e2ce93204277d2a..aa1aed3c2fce4a0ecbfc7214299621724df27fdf 100644 (file)
@@ -4,6 +4,7 @@
 #include "binarypackage.h"
 #include "builder.h"
 #include "filetarget.h"
+#include "staticlibrary.h"
 
 using namespace std;
 using namespace Msp;
@@ -75,6 +76,7 @@ void BinaryPackage::do_prepare()
        if(base_path.empty())
        {
                // TODO report which files were not found
+               builder.get_logger().log("problems", format("Cannot locate files for %s", name));
                problems.push_back("Cannot locate files");
                return;
        }
@@ -99,17 +101,15 @@ void BinaryPackage::do_prepare()
                BuildInfo::PathList combined_libpath = static_binfo.libpath;
                combined_libpath.insert(combined_libpath.end(), export_binfo.libpath.begin(), export_binfo.libpath.end());
 
-               Target::Dependencies static_dep_libs;
-               for(BuildInfo::WordList::const_iterator i=static_binfo.libs.begin(); i!=static_binfo.libs.end(); ++i)
-                       if(Target *lib = builder.get_vfs().find_library(*i, combined_libpath, BuildInfo::STATIC, system))
-                               static_dep_libs.push_back(lib);
-
                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))
-                       {
-                               for(Target::Dependencies::const_iterator j=static_dep_libs.begin(); j!=static_dep_libs.end(); ++j)
-                                       lib->add_transitive_dependency(**j);
-                       }
+                               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);
+                               }
        }
 }