build system: handle OS-specific source file names everywhere

…and not just in the src/mkvtoolnix-gui sub-directory.
This commit is contained in:
Moritz Bunkus 2018-11-04 18:17:23 +01:00
parent 589af4f0b7
commit d1cd5f2ffe
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -77,7 +77,7 @@ class Target
list = list.collect { |e| e.respond_to?(:to_a) ? e.to_a : e }.flatten
file_mode = (options[:type] || :file) == :file
except = !file_mode && options[:except].is_a?(Array) ? options[:except].collect { |file| list.collect { |dir| "#{dir}/#{file}" } }.flatten.to_hash_by : {}
new_sources = list.collect { |entry| file_mode ? (entry.respond_to?(:to_a) ? entry.to_a : entry) : FileList["#{entry}/*.c", "#{entry}/*.cpp", "#{entry}/*.cc"].to_a }.flatten.select { |file| !except[file] }
new_sources = list.collect { |entry| file_mode ? (entry.respond_to?(:to_a) ? entry.to_a : entry) : FileList["#{entry}/*.c", "#{entry}/*.cpp", "#{entry}/*.cc"].to_a }.flatten.select { |file| !except[file] }.for_target!
new_deps = new_sources.collect { |file| [ file.ext(ext_map[ file.pathmap('%x') ] || 'o'), file ] }
new_file_deps = new_deps.reject { |src, tgt| no_file_deps_re.match src }
new_file_deps += new_sources.select { |file| %r{\.moc$}.match file }.map { |file| [ file, file.ext('h') ] }