]> git.tdb.fi Git - builder.git/blobdiff - source/binary.cpp
Avoid a double verb in function name
[builder.git] / source / binary.cpp
index 5856c19e539bde29901e7d7ba0fdfcf1247e2077..e7b5e818d4e42f3f78272347d1258ec7e883cb49 100644 (file)
@@ -18,7 +18,7 @@ Binary::Binary(Builder &b, const FS::Path &p):
 { }
 
 Binary::Binary(Builder &b, const Component &c, const string &p, const list<ObjectFile *> &objs):
-       FileTarget(b, c.get_package(), c.get_package().get_out_dir()/p),
+       FileTarget(b, c.get_package(), c.get_package().get_output_directory()/p),
        objects(objs)
 {
        component = &c;
@@ -33,6 +33,7 @@ void Binary::find_dependencies()
 
        list<const Component *> queue;
        list<Target *> dep_libs;
+       set<string> missing_libs;
        queue.push_back(component);
        while(!queue.empty())
        {
@@ -46,15 +47,18 @@ void Binary::find_dependencies()
                        Target *lib = builder.get_vfs().find_library(*i, binfo.libpath, libmode);
                        if(lib)
                        {
-                               dep_libs.push_back(lib);
-
-                               lib = lib->get_real_target();
-                               if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(lib))
+                               Target *real = lib->get_real_target();
+                               if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(real))
+                               {
+                                       dep_libs.push_back(stlib);
                                        if(stlib->get_component())
                                                queue.push_back(stlib->get_component());
+                               }
+                               else
+                                       dep_libs.push_back(lib);
                        }
-                       else
-                               builder.problem(package->get_name(), format("Couldn't find library %s for %s", *i, name));
+                       else if(missing_libs.insert(*i).second)
+                               problems.push_back(format("Required library %s not found", *i));
                }
        }