aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula_support.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-03-05 21:08:08 -0800
committerAdam Vandenberg2012-03-05 21:14:48 -0800
commit962f4fa9ef4492fa62fc4c8aa6d827fa6d3f3590 (patch)
tree0cdd9a85d95c16ab14b1b94fe3607962b58268e2 /Library/Homebrew/formula_support.rb
parentfca0a6664954da0051fd3857378569f760fc2e8e (diff)
downloadbrew-962f4fa9ef4492fa62fc4c8aa6d827fa6d3f3590.tar.bz2
Move llvm method to FailsWithLLVM
Diffstat (limited to 'Library/Homebrew/formula_support.rb')
-rw-r--r--Library/Homebrew/formula_support.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index 6314f2951..df98f3cb4 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -92,4 +92,38 @@ class FailsWithLLVM
s += "\n"
return s
end
+
+ def handle_failure
+ return unless ENV.compiler == :llvm
+
+ # version 2336 is the latest version as of Xcode 4.2, so it is the
+ # latest version we have tested against so we will switch to GCC and
+ # bump this integer when Xcode 4.3 is released. TODO do that!
+ if build.to_i >= 2336
+ if MacOS.xcode_version < "4.2"
+ opoo "Formula will not build with LLVM, using GCC"
+ ENV.gcc
+ else
+ opoo "Formula will not build with LLVM, trying Clang"
+ ENV.clang
+ end
+ return
+ end
+ opoo "Building with LLVM, but this formula is reported to not work with LLVM:"
+ puts
+ puts reason
+ puts
+ puts <<-EOS.undent
+ We are continuing anyway so if the build succeeds, please open a ticket with
+ the following information: #{MacOS.llvm_build_version}-#{MACOS_VERSION}. So
+ that we can update the formula accordingly. Thanks!
+ EOS
+ puts
+ if MacOS.xcode_version < "4.2"
+ puts "If it doesn't work you can: brew install --use-gcc"
+ else
+ puts "If it doesn't work you can try: brew install --use-clang"
+ end
+ puts
+ end
end