Remove to_flags monkeypatch
This commit is contained in:
parent
d1041319f4
commit
7498cfff99
@ -232,7 +232,7 @@ class Cmd
|
|||||||
syslibpath
|
syslibpath
|
||||||
end
|
end
|
||||||
def ldflags
|
def ldflags
|
||||||
args = libpath.to_flags('-L')
|
args = path_flags("-L", libpath)
|
||||||
case mode
|
case mode
|
||||||
when :ld then args << '-headerpad_max_install_names'
|
when :ld then args << '-headerpad_max_install_names'
|
||||||
when :ccld then args << '-Wl,-headerpad_max_install_names'
|
when :ccld then args << '-Wl,-headerpad_max_install_names'
|
||||||
@ -247,7 +247,7 @@ class Cmd
|
|||||||
sys, opt = cpath
|
sys, opt = cpath
|
||||||
# we want our keg-only includes to be found before system includes *and*
|
# we want our keg-only includes to be found before system includes *and*
|
||||||
# before any other includes the build-system adds
|
# 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
|
end
|
||||||
def make_fuss args
|
def make_fuss args
|
||||||
return unless make_fuss?
|
return unless make_fuss?
|
||||||
@ -278,6 +278,10 @@ class Cmd
|
|||||||
path = path.realpath if path.exist?
|
path = path.realpath if path.exist?
|
||||||
path.to_s
|
path.to_s
|
||||||
end
|
end
|
||||||
|
def path_flags(prefix, paths)
|
||||||
|
paths = paths.uniq.select { |path| File.directory?(path) }
|
||||||
|
paths.map! { |path| prefix + path }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if __FILE__ == $PROGRAM_NAME
|
if __FILE__ == $PROGRAM_NAME
|
||||||
|
|||||||
@ -13,9 +13,3 @@ class NilClass
|
|||||||
def chuzzle; end
|
def chuzzle; end
|
||||||
def split(x); [] end
|
def split(x); [] end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Array
|
|
||||||
def to_flags prefix
|
|
||||||
select { |path| File.directory? path }.uniq.map { |path| prefix + path }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user