Default to LLVM for Xcodes that default to LLVM
This commit is contained in:
parent
cf1a6e185c
commit
a32e738f7c
@ -21,10 +21,6 @@ module HomebrewEnvExtension
|
||||
# llvm allows -O4 however it often fails to link and is very slow
|
||||
cflags = ['-O3']
|
||||
|
||||
# If these aren't set, many formulae fail to build
|
||||
self['CC'] = '/usr/bin/cc'
|
||||
self['CXX'] = '/usr/bin/c++'
|
||||
|
||||
case self.compiler
|
||||
when :clang then self.clang
|
||||
when :llvm then self.llvm
|
||||
@ -338,7 +334,7 @@ Please take one of the following actions:
|
||||
elsif self['HOMEBREW_USE_GCC']
|
||||
:gcc
|
||||
else
|
||||
:gcc
|
||||
MacOS.default_compiler
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -246,6 +246,14 @@ module MacOS extend self
|
||||
Pathname.new("/usr/bin/cc").realpath.basename.to_s
|
||||
end
|
||||
|
||||
def default_compiler
|
||||
case default_cc
|
||||
when /^gcc/ then :gcc
|
||||
when /^llvm/ then :llvm
|
||||
when "clang" then :clang
|
||||
end
|
||||
end
|
||||
|
||||
def gcc_42_build_version
|
||||
`/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/
|
||||
if $1
|
||||
|
Loading…
x
Reference in New Issue
Block a user