]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Reorder class members
[builder.git] / source / component.cpp
index 29bf9d10e692445bafe68c2e7095d46afa3fbadf..dcbaf373e19c0c16360fbfa468988575767fd5ff 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-200 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -33,9 +33,6 @@ Component::Component(SourcePackage &p, Type t, const string &n):
        deflt(true)
 { }
 
-/**
-Prepares the build information for building.
-*/
 void Component::create_build_info()
 {
        build_info.add(pkg.get_build_info());
@@ -48,6 +45,17 @@ void Component::create_build_info()
        for(StringList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i)
                *i=(pkg.get_source() / *i).str();
 
+       if(pkg.get_library_mode()!=DYNAMIC)
+       {
+               // XXX This may pull in some unnecessary libpaths too.  More thought required.
+               PackageList reqs=pkg.collect_requires();
+               for(PackageList::iterator i=reqs.begin(); i!=reqs.end(); ++i)
+               {
+                       const BuildInfo &ebi=(*i)->get_exported_binfo();
+                       build_info.libpath.insert(build_info.libpath.end(), ebi.libpath.begin(), ebi.libpath.end());
+               }
+       }
+
        if(type==PROGRAM)
        {
                string strip=pkg.get_config().get_option("strip").value;
@@ -70,9 +78,6 @@ void Component::create_build_info()
        build_info.unique();
 }
 
-/**
-Creates all targets needed for building this component.
-*/
 void Component::create_targets() const
 {
        Builder &builder=pkg.get_builder();
@@ -110,7 +115,7 @@ void Component::create_targets() const
 
        if(build_exe)
        {
-               Executable    *exe=0;
+               Executable *exe=0;
                StaticLibrary *slib=0;
                if(type==LIBRARY)
                {
@@ -144,9 +149,6 @@ void Component::create_targets() const
                inst_tgt->add_depend(new Install(builder, pkg, **i));
 }
 
-/**
-Collects all files belonging to the component.
-*/
 PathList Component::collect_source_files() const
 {
        PathList files;