X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinary.cpp;h=e7b5e818d4e42f3f78272347d1258ec7e883cb49;hb=c194bac9d508999c046a1f56c80b9419f77a8590;hp=5856c19e539bde29901e7d7ba0fdfcf1247e2077;hpb=323285f97a1a6fe2628f818371a8b03f233dd036;p=builder.git diff --git a/source/binary.cpp b/source/binary.cpp index 5856c19..e7b5e81 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -18,7 +18,7 @@ Binary::Binary(Builder &b, const FS::Path &p): { } Binary::Binary(Builder &b, const Component &c, const string &p, const list &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 queue; list dep_libs; + set 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(lib)) + Target *real = lib->get_real_target(); + if(StaticLibrary *stlib = dynamic_cast(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)); } }