mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-10-22 07:21:21 +00:00
build system: exclude OS-specific files ending with e.g. …_windows.cpp
This commit is contained in:
parent
81cfb605db
commit
0749f774c9
@ -56,10 +56,20 @@ class Array
|
||||
def for_target!
|
||||
self.flatten!
|
||||
|
||||
self.reject! { |f| %r{(?:/|^)linux[_.]}.match f } unless $building_for[:linux]
|
||||
self.reject! { |f| %r{(?:/|^)macos[_.]}.match f } unless $building_for[:macos]
|
||||
self.reject! { |f| %r{(?:/|^)unix[_.]}.match f } if $building_for[:windows]
|
||||
self.reject! { |f| %r{(?:/|^)windows[_.]}.match f } unless $building_for[:windows]
|
||||
reject = {
|
||||
:linux => %w{ macos windows},
|
||||
:macos => %w{linux windows x11},
|
||||
:windows => %w{linux macos unix x11},
|
||||
}
|
||||
|
||||
reject.each do |os, types|
|
||||
next if !$building_for[os]
|
||||
|
||||
re = '(?:' + types.join('|') + ')'
|
||||
re = %r{(?:/|^)#{re}[_.]|_#{re}\.[a-z]+$}
|
||||
|
||||
self.reject! { |f| re.match f }
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user