X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinarycomponent.cpp;h=49c4897ce69d7d25492ebe1521257dca04c77062;hb=266697cea92aed098fff31c1ddd4a4bfab3a683f;hp=0d3e253b3d5d4afc8714fe8e16eff45724ab348c;hpb=35f2979869bff43706f3163ec0979c7084aaa3c4;p=builder.git diff --git a/source/binarycomponent.cpp b/source/binarycomponent.cpp index 0d3e253..49c4897 100644 --- a/source/binarycomponent.cpp +++ b/source/binarycomponent.cpp @@ -32,7 +32,7 @@ void BinaryComponent::create_build_info() if(!(*i)->get_install()) { build_info.libmodes[(*i)->get_name()] = BuildInfo::STATIC; - build_info.libpath.push_back((*i)->get_package().get_source_directory()); + build_info.libpath.push_back((*i)->get_package().get_output_directory()); } } @@ -56,7 +56,7 @@ void BinaryComponent::create_targets() const list objs; SourceList source_filenames = collect_source_files(); - for(SourceList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) + for(SourceList::iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) { string ext = FS::extpart(FS::basename(*i)); Target *src = 0; @@ -64,12 +64,30 @@ void BinaryComponent::create_targets() const Tool *gen = pkg_tools.get_tool_for_suffix(ext); if(gen) { - Target *tmpl = gen->create_source(*this, *i); - if(tmpl) + list templates; + templates.push_back(gen->create_source(*this, *i)); + + Tool::ProcessingUnit processing_unit = gen->get_processing_unit(); + if(processing_unit!=Tool::ONE_FILE) { - src = gen->create_target(*tmpl); - ext = FS::extpart(FS::basename(dynamic_cast(*src).get_path())); + FS::Path source_dir = FS::dirname(*i); + SourceList::iterator j = i; + for(++j; j!=source_filenames.end(); ) + { + if((processing_unit!=Tool::DIRECTORY || FS::dirname(*j)==source_dir) && + pkg_tools.get_tool_for_suffix(FS::extpart(FS::basename(*j)))==gen) + { + templates.push_back(gen->create_source(*this, *j)); + // Remove additional files so they won't get processed again + source_filenames.erase(j++); + } + else + ++j; + } } + + src = gen->create_target(templates); + ext = FS::extpart(FS::basename(dynamic_cast(*src).get_path())); } Tool *tool = toolchain.get_tool_for_suffix(ext, true); @@ -122,7 +140,7 @@ void BinaryComponent::create_targets() const } BinaryComponent::Loader::Loader(BinaryComponent &c): - DerivedObjectLoader(c) + DataFile::DerivedObjectLoader(c) { add("use", &Loader::use); }