Skip to content
Snippets Groups Projects
Commit 6aeb848b authored by Chris Hoffman's avatar Chris Hoffman Committed by Adam Vandenberg
Browse files

Refactor llvm compiler selection so formula can use it

parent 154d0fa9
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,7 @@ module HomebrewEnvExtension
end
if MACOS_VERSION >= 10.6 and (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm')
# you can install Xcode wherever you like you know.
xcode_path = `/usr/bin/xcode-select -print-path`.chomp
xcode_path = "/Developer" if xcode_path.to_s.empty?
ENV['CC'] = "#{xcode_path}/usr/bin/llvm-gcc"
ENV['CXX'] = "#{xcode_path}/usr/bin/llvm-g++"
cflags = %w{-O4} # link time optimisation baby!
self.llvm
else
# if we don't set these, many formula fail to build
ENV['CC'] = '/usr/bin/cc'
......@@ -117,6 +111,17 @@ module HomebrewEnvExtension
self.O3
end
def llvm
# you can install Xcode wherever you like you know.
xcode_path = `/usr/bin/xcode-select -print-path`.chomp
xcode_path = "/Developer" if xcode_path.to_s.empty?
ENV['CC'] = "#{xcode_path}/usr/bin/llvm-gcc"
ENV['CXX'] = "#{xcode_path}/usr/bin/llvm-g++"
cflags = %w{-O4} # link time optimisation baby!
self['LD'] = self['CC']
end
def osx_10_4
self['MACOSX_DEPLOYMENT_TARGET']="10.4"
remove_from_cflags(/ ?-mmacosx-version-min=10\.\d/)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment