Fix duplicate -stdlib flags in cxxld mode

When the cc wrapper is in cxxld mode, -stdlib= is added by both cxxflags
and ldflags, but they are never used separately, so this results in
duplicate flags.
This commit is contained in:
Jack Nagel 2014-05-10 17:10:40 -05:00
parent df3e6bade5
commit cbd018a2db

View File

@ -271,12 +271,10 @@ class Cmd
def ldflags def ldflags
args = path_flags("-L", libpath) args = path_flags("-L", libpath)
case mode case mode
when :ld then args << '-headerpad_max_install_names' when :ld
when :ccld then args << '-Wl,-headerpad_max_install_names' args << "-headerpad_max_install_names"
when :cxxld when :ccld, :cxxld
args << '-Wl,-headerpad_max_install_names' args << "-Wl,-headerpad_max_install_names"
args << '-stdlib=libc++' if cccfg? 'g'
args << '-stdlib=libstdc++' if cccfg? 'h'
end end
args args
end end