X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=f5ca812169c3d4b4910289c4bf97a8d1962fd502;hb=75ac80cb255e4def7ee685ce9c46db7c2f6625aa;hp=3c5a40945ed56184e4776edd7cb74b0ec3ee5b91;hpb=e0c863681c8a5fad5918bb7730ecbc65fbdfbc64;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index 3c5a409..f5ca812 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -158,23 +158,6 @@ void Component::create_targets() const if(install) inst_list.push_back(result); } - else - { - for(PathList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) - { - string ext = FS::extpart(FS::basename(*i)); - if(ext==".h") - { - FileTarget *hdr = builder.get_vfs().get_target(*i); - if(!hdr) - hdr = new CSourceFile(builder, *this, *i); - - // Install headers if requested - if(type==HEADERS && install) - inst_list.push_back(hdr); - } - } - } if(type==PROGRAM || type==LIBRARY || type==MODULE) { @@ -182,12 +165,18 @@ void Component::create_targets() const for(PathList::const_iterator i=source_filenames.begin(); i!=source_filenames.end(); ++i) { string ext = FS::extpart(FS::basename(*i)); - const Tool *tool = toolchain.get_tool_for_suffix(ext); + const Tool *tool = toolchain.get_tool_for_suffix(ext, true); if(tool) { Target *src = tool->create_source(*this, *i); - Target *obj = tool->create_target(*src); - objs.push_back(obj); + if(tool->accepts_suffix(ext)) + { + Target *obj = tool->create_target(*src); + objs.push_back(obj); + } + + if(type==LIBRARY && install && !dynamic_cast(src)->get_install_location().empty()) + inst_list.push_back(src); } } @@ -256,17 +245,6 @@ Component::Loader::Loader(Component &c): add("default", &Component::deflt); } -void Component::Loader::finish() -{ - if(!inst_hdr.empty()) - { - Component hdrcomp(comp.pkg, HEADERS, inst_hdr); - hdrcomp.sources = comp.sources; - hdrcomp.install = true; - const_cast(comp.pkg.get_components()).push_back(hdrcomp); - } -} - void Component::Loader::source(const string &s) { comp.sources.push_back(s);