From c5813040693fb4f30adb3af07969c1c44d4af260 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 20 Jan 2011 15:03:15 +0100 Subject: [PATCH] Don't add objects files more than once during linking --- rake.d/target.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rake.d/target.rb b/rake.d/target.rb index 207c6ea3a..cd3fc604d 100644 --- a/rake.d/target.rb +++ b/rake.d/target.rb @@ -61,10 +61,10 @@ class Target file_mode = (options[:type] || :file) == :file new_sources = list.collect { |entry| file_mode ? (entry.respond_to?(:to_a) ? entry.to_a : entry) : FileList["#{entry}/*.c", "#{entry}/*.cpp"].to_a }.flatten new_deps = new_sources.collect { |file| [ file.ext(ext_map[ file.pathmap('%x') ] || 'o'), file ] } - @sources += new_sources - @objects += new_deps.collect(&:first).select { |file| /\.o$/.match file } - @dependencies += new_deps.collect(&:first) - @file_deps += new_deps + @sources = ( @sources + new_sources ).uniq + @objects = ( @objects + new_deps.collect(&:first).select { |file| /\.o$/.match file } ).uniq + @dependencies = ( @dependencies + new_deps.collect(&:first) ).uniq + @file_deps = ( @file_deps + new_deps ).uniq self end