Remove to_flags monkeypatch

This commit is contained in:
Jack Nagel 2014-04-20 19:54:32 -05:00
parent d1041319f4
commit 7498cfff99
2 changed files with 6 additions and 8 deletions

View File

@ -232,7 +232,7 @@ class Cmd
syslibpath
end
def ldflags
args = libpath.to_flags('-L')
args = path_flags("-L", libpath)
case mode
when :ld then args << '-headerpad_max_install_names'
when :ccld then args << '-Wl,-headerpad_max_install_names'
@ -247,7 +247,7 @@ class Cmd
sys, opt = cpath
# we want our keg-only includes to be found before system includes *and*
# before any other includes the build-system adds
sys.to_flags('-isystem') + opt.to_flags('-I')
path_flags("-isystem", sys) + path_flags("-I", opt)
end
def make_fuss args
return unless make_fuss?
@ -278,6 +278,10 @@ class Cmd
path = path.realpath if path.exist?
path.to_s
end
def path_flags(prefix, paths)
paths = paths.uniq.select { |path| File.directory?(path) }
paths.map! { |path| prefix + path }
end
end
if __FILE__ == $PROGRAM_NAME

View File

@ -13,9 +13,3 @@ class NilClass
def chuzzle; end
def split(x); [] end
end
class Array
def to_flags prefix
select { |path| File.directory? path }.uniq.map { |path| prefix + path }
end
end