X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=04c9d17204dd8729cc2b56993bd9697041f480d5;hb=8d7926359d2477a9928d7367678314bcbc1f6e81;hp=c440e4c90df9c07c30db084f75d5fc8678963d73;hpb=87ea54db19306434bac3e765c9bd3464fd53f390;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index c440e4c..04c9d17 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -40,6 +40,15 @@ Component::Component(SourcePackage &p, Type t, const string &n): deflt(true) { } +void Component::configure(const StringMap &opts, unsigned flag) +{ + for(StringList::iterator i=sources.begin(); i!=sources.end(); ++i) + *i = (pkg.get_source()/pkg.expand_string(*i)).str(); + + for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) + (*i)->configure(opts, flag&2); +} + void Component::create_build_info() { const PackageList &pkg_reqs = pkg.get_requires(); @@ -99,9 +108,9 @@ void Component::create_build_info() } else if(module_host) { - const PathList &host_src = module_host->get_sources(); - for(PathList::const_iterator i=host_src.begin(); i!=host_src.end(); ++i) - build_info.incpath.push_back(i->str()); + const StringList &host_src = module_host->get_sources(); + for(StringList::const_iterator i=host_src.begin(); i!=host_src.end(); ++i) + build_info.incpath.push_back(*i); } build_info.unique(); @@ -245,16 +254,17 @@ void Component::create_targets() const PathList Component::collect_source_files() const { PathList files; - for(PathList::const_iterator i=sources.begin(); i!=sources.end(); ++i) + for(StringList::const_iterator i=sources.begin(); i!=sources.end(); ++i) { - if(FS::is_dir(*i)) + FS::Path path(*i); + if(FS::is_dir(path)) { - list sfiles = list_files(*i); + list sfiles = list_files(path); for(list::iterator j=sfiles.begin(); j!=sfiles.end(); ++j) - files.push_back(*i / *j); + files.push_back(path / *j); } else - files.push_back(*i); + files.push_back(path); } return files; @@ -287,7 +297,7 @@ void Component::Loader::finish() void Component::Loader::source(const string &s) { - comp.sources.push_back(comp.pkg.get_source()/s); + comp.sources.push_back(s); } void Component::Loader::require(const string &n)