X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=e674b018aabf42c338585ef6072e76f70221f111;hb=69ad3610053e140cb5108f53e4c46a0583e33559;hp=e33867680fb420e927d7abe20f5b524fe737defd;hpb=c679a9dd1a97ae3b1ffa568143d42d02c2ca9e74;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index e338676..e674b01 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -5,7 +5,7 @@ Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include +#include #include #include #include "builder.h" @@ -41,6 +41,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; @@ -81,7 +86,7 @@ void Component::create_targets() const for(PathList::const_iterator i=files.begin(); i!=files.end(); ++i) { string basename=(*i)[-1]; - string ext=Path::splitext(basename).ext; + string ext=splitext(basename).ext; if((ext==".cpp" || ext==".c") && build_exe) { SourceFile *src=new SourceFile(builder, this, i->str()); @@ -114,7 +119,7 @@ void Component::create_targets() const else exe=new Executable(builder, *this, objs); - if(&pkg==builder.get_default_package() && deflt) + if(&pkg==builder.get_main_package() && deflt) { def_tgt->add_depend(exe); if(slib) def_tgt->add_depend(slib); @@ -146,8 +151,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); + struct stat st=stat(*i); if(S_ISDIR(st.st_mode)) { list sfiles=list_files(*i);