mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
Don't add objects files more than once during linking
This commit is contained in:
parent
da1ff39b7e
commit
c581304069
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user