X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexecutable.cpp;h=db8bd11db0b3c832790d3cbdbef4d2f717ad80fd;hb=b6dcf65b5e1b99f6c65454358c7610f3e9c8af2b;hp=1f23990da93ca569af5476a7032a468d597549d4;hpb=57bdb055acb0453c75b22cb64f35cc0e817a2827;p=builder.git diff --git a/source/executable.cpp b/source/executable.cpp index 1f23990..db8bd11 100644 --- a/source/executable.cpp +++ b/source/executable.cpp @@ -28,8 +28,8 @@ void Executable::find_depends() { LibMode libmode=package->get_library_mode(); - //XXX Duplicate libraries? list queue; + list dep_libs; queue.push_back(&comp); while(!queue.empty()) { @@ -44,7 +44,8 @@ void Executable::find_depends() { if(contains(depends, lib)) continue; - add_depend(lib); + + dep_libs.push_front(lib); if(dynamic_cast(lib)) lib=lib->get_depends().front(); @@ -57,6 +58,9 @@ void Executable::find_depends() } } + for(list::iterator i=dep_libs.begin(); i!=dep_libs.end(); ++i) + add_depend(*i); + deps_ready=true; } @@ -72,11 +76,22 @@ we need to pass the value to the Target c'tor. string Executable::generate_target_name(const Component &c) { string prefix,suffix; + const string &arch=c.get_package().get_arch(); if(c.get_type()==Component::LIBRARY) { prefix="lib"; - suffix=".so"; + if(arch=="win32") + suffix=".dll"; + else + suffix=".so"; + } + else if(c.get_type()==Component::MODULE) + suffix=".m"; + else if(c.get_type()==Component::PROGRAM) + { + if(arch=="win32") + suffix=".exe"; } return (c.get_package().get_out_dir()/(prefix+c.get_name()+suffix)).str();