Make these methods on ENV.
This commit is contained in:
parent
7a9c72cf62
commit
3977beb8ed
@ -18,15 +18,15 @@ module HomebrewEnvExtension
|
|||||||
self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
|
self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if MACOS_VERSION >= 10.6 and (self['HOMEBREW_USE_CLANG'] or ARGV.include? '--use-clang')
|
if MACOS_VERSION >= 10.6 and self.use_clang?
|
||||||
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang"
|
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang"
|
||||||
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++"
|
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++"
|
||||||
cflags = ['-O3'] # -O4 makes the linker fail on some formulae
|
cflags = ['-O3'] # -O4 makes the linker fail on some formulae
|
||||||
elsif MACOS_VERSION >= 10.6 and (self['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm')
|
elsif MACOS_VERSION >= 10.6 and self.use_llvm?
|
||||||
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc"
|
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc"
|
||||||
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++"
|
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++"
|
||||||
cflags = ['-O4'] # link time optimisation baby!
|
cflags = ['-O4'] # link time optimisation baby!
|
||||||
elsif MACOS_VERSION >= 10.6 and (self['HOMEBREW_USE_GCC'] or ARGV.include? '--use-gcc')
|
elsif MACOS_VERSION >= 10.6 and self.use_gcc?
|
||||||
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc"
|
self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc"
|
||||||
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++"
|
self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++"
|
||||||
cflags = ['-O3']
|
cflags = ['-O3']
|
||||||
@ -292,4 +292,14 @@ Please take one of the following actions:
|
|||||||
remove 'CFLAGS', f
|
remove 'CFLAGS', f
|
||||||
remove 'CXXFLAGS', f
|
remove 'CXXFLAGS', f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def use_clang?
|
||||||
|
self['HOMEBREW_USE_CLANG'] or ARGV.include? '--use-clang'
|
||||||
|
end
|
||||||
|
def use_gcc?
|
||||||
|
self['HOMEBREW_USE_GCC'] or ARGV.include? '--use-gcc'
|
||||||
|
end
|
||||||
|
def use_llvm?
|
||||||
|
self['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user