mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Add formula name to LLVM warning
This commit is contained in:
parent
76dcc1929b
commit
18f9969b65
@ -217,6 +217,27 @@ class Formula
|
||||
"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -Wno-dev"
|
||||
end
|
||||
|
||||
def fails_with_llvm msg="", data=nil
|
||||
return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm')
|
||||
|
||||
build = data.delete :build rescue nil
|
||||
msg = "(No specific reason was given)" if msg.empty?
|
||||
|
||||
opoo "LLVM was requested, but this formula is reported as not working with LLVM:"
|
||||
puts msg
|
||||
puts "Tested with LLVM build #{build}" unless build == nil
|
||||
puts
|
||||
|
||||
if ARGV.force?
|
||||
puts "Continuing anyway. If this works, let us know so we can update the\n"+
|
||||
"formula to remove the warning."
|
||||
else
|
||||
puts "Continuing with GCC 4.2 instead.\n"+
|
||||
"(Use `brew install --force #{name}` to force use of LLVM.)"
|
||||
ENV.gcc_4_2
|
||||
end
|
||||
end
|
||||
|
||||
def self.class_s name
|
||||
#remove invalid characters and then camelcase it
|
||||
name.capitalize.gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase } \
|
||||
@ -281,27 +302,6 @@ class Formula
|
||||
self.class.external_deps
|
||||
end
|
||||
|
||||
def fails_with_llvm msg="", data=nil
|
||||
return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm')
|
||||
|
||||
build = data.delete :build rescue nil
|
||||
msg = "(No specific reason was given)" if msg.empty?
|
||||
|
||||
opoo "LLVM was requested, but this formula is reported as not working with LLVM:"
|
||||
puts msg
|
||||
puts "Tested with LLVM build #{build}" unless build == nil
|
||||
puts
|
||||
|
||||
if ARGV.force?
|
||||
puts "Continuing anyway. If this works, let us know so we can update the\n"+
|
||||
"formula to remove the warning."
|
||||
else
|
||||
puts "Continuing with GCC 4.2 instead.\n"+
|
||||
"(Use `brew install --force ...` to force use of LLVM.)"
|
||||
ENV.gcc_4_2
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
# Pretty titles the command and buffers stdout/stderr
|
||||
# Throws if there's an error
|
||||
|
Loading…
x
Reference in New Issue
Block a user