Use a case statement

This commit is contained in:
Jack Nagel 2014-05-13 16:23:12 -05:00
parent cb873d0833
commit 230161c1de

View File

@ -267,10 +267,11 @@ module Superenv
end end
def cxx11 def cxx11
if self['HOMEBREW_CC'] == 'clang' case self["HOMEBREW_CC"]
when "clang"
append 'HOMEBREW_CCCFG', "x", '' append 'HOMEBREW_CCCFG', "x", ''
append 'HOMEBREW_CCCFG', "g", '' append 'HOMEBREW_CCCFG', "g", ''
elsif self['HOMEBREW_CC'] =~ /gcc-4\.(8|9)/ when /gcc-4\.(8|9)/
append 'HOMEBREW_CCCFG', "x", '' append 'HOMEBREW_CCCFG', "x", ''
else else
raise "The selected compiler doesn't support C++11: #{self['HOMEBREW_CC']}" raise "The selected compiler doesn't support C++11: #{self['HOMEBREW_CC']}"