X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=29bf9d10e692445bafe68c2e7095d46afa3fbadf;hb=a2adbd9c0a8d7a7567848c4c6bdbf0de6ba32bb1;hp=07cd6ea5aee874df889e4c34c49c77ae12ae5356;hpb=1968c546cfb30214e8dc5afc722bec14aa8373f5;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index 07cd6ea..29bf9d1 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -5,8 +5,10 @@ Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include -#include +#include +#include +#include +#include #include #include "builder.h" #include "component.h" @@ -41,6 +43,11 @@ void Component::create_build_info() for(PackageList::iterator i=requires.begin(); i!=requires.end(); ++i) build_info.add((*i)->get_exported_binfo()); + for(StringList::iterator i=build_info.incpath.begin(); i!=build_info.incpath.end(); ++i) + *i=(pkg.get_source() / *i).str(); + for(StringList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i) + *i=(pkg.get_source() / *i).str(); + if(type==PROGRAM) { string strip=pkg.get_config().get_option("strip").value; @@ -80,8 +87,7 @@ void Component::create_targets() const list inst_tgts; for(PathList::const_iterator i=files.begin(); i!=files.end(); ++i) { - string basename=(*i)[-1]; - string ext=Path::splitext(basename).ext; + string ext=FS::extpart(FS::basename(*i)); if((ext==".cpp" || ext==".c") && build_exe) { SourceFile *src=new SourceFile(builder, this, i->str()); @@ -146,9 +152,7 @@ PathList Component::collect_source_files() const PathList files; for(PathList::const_iterator i=sources.begin(); i!=sources.end(); ++i) { - struct stat st; - stat(*i, st); - if(S_ISDIR(st.st_mode)) + if(FS::is_dir(*i)) { list sfiles=list_files(*i); for(list::iterator j=sfiles.begin(); j!=sfiles.end(); ++j)