aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/compilers.rb6
-rw-r--r--Library/Homebrew/formula.rb9
2 files changed, 8 insertions, 7 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index b9fb9e199..ad6c6b4c1 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -48,6 +48,12 @@ class CompilerFailure
instance_eval(&block) if block_given?
end
+ def ===(compiler)
+ name == compiler.name &&
+ major_version == compiler.major_version &&
+ version >= (compiler.version || 0)
+ end
+
MESSAGES = {
:cxx11 => "This compiler does not support C++11"
}
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 4c99de692..ab5b00fa2 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -231,13 +231,8 @@ class Formula
self.class.keg_only_reason
end
- def fails_with? cc
- (self.class.cc_failures || []).any? do |failure|
- # Major version check distinguishes between, e.g.,
- # GCC 4.7.1 and GCC 4.8.2, where a comparison is meaningless
- failure.name == cc.name && failure.major_version == cc.major_version &&
- failure.version >= (cc.version || 0)
- end
+ def fails_with? compiler
+ (self.class.cc_failures || []).any? { |failure| failure === compiler }
end
# sometimes the formula cleaner breaks things