From 2f5311c7ed2735926b6fb107a657e77ac331e4c1 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 10 Oct 2014 22:08:45 +0300 Subject: [PATCH] Only use files from the first overlay that has them This allows special-casing pieces of code for some platforms without fragmenting the directory structure too badly. --- source/component.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/component.cpp b/source/component.cpp index 833a0ed..a42b81c 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -99,12 +99,21 @@ Component::SourceList Component::collect_source_files() const if(FS::is_dir(opath)) dirs.push_back(opath); } + set overlay_files; for(SourceList::const_iterator j=dirs.begin(); j!=dirs.end(); ++j) { package.get_builder().get_logger().log("files", format("Traversing %s", *j)); list sfiles = list_files(*j); for(list::iterator k=sfiles.begin(); k!=sfiles.end(); ++k) + { + if(j!=dirs.begin()) + { + if(overlay_files.count(*k)) + continue; + overlay_files.insert(*k); + } files.push_back(*j / *k); + } } } else -- 2.45.2