X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinarycomponent.cpp;h=74ac0baf5c550ce3a349581da8a730d52a64d054;hb=4e2a160d94ca808cfb511cc2d38e115d989809f2;hp=0d3e253b3d5d4afc8714fe8e16eff45724ab348c;hpb=35f2979869bff43706f3163ec0979c7084aaa3c4;p=builder.git diff --git a/source/binarycomponent.cpp b/source/binarycomponent.cpp index 0d3e253..74ac0ba 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()); } } @@ -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::const_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); }