Treat HOMEBREW_CC the same as --cc

Closes Homebrew/homebrew#29762.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Shaun Jackman 2014-06-01 08:58:24 -07:00 committed by Jack Nagel
parent 6e56009217
commit bd682d5519

View File

@ -94,7 +94,7 @@ module SharedEnvExtension
def fcflags; self['FCFLAGS']; end def fcflags; self['FCFLAGS']; end
def compiler def compiler
@compiler ||= if (cc = ARGV.cc) @compiler ||= if (cc = [ARGV.cc, homebrew_cc].compact.first)
COMPILER_SYMBOL_MAP.fetch(cc) do |other| COMPILER_SYMBOL_MAP.fetch(cc) do |other|
case other case other
when GNU_GCC_REGEXP when GNU_GCC_REGEXP
@ -103,8 +103,6 @@ module SharedEnvExtension
raise "Invalid value for --cc: #{other}" raise "Invalid value for --cc: #{other}"
end end
end end
elsif homebrew_cc
COMPILER_SYMBOL_MAP.fetch(homebrew_cc) { MacOS.default_compiler }
else else
MacOS.default_compiler MacOS.default_compiler
end end