aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-09-21 00:53:15 -0500
committerJack Nagel2014-09-21 00:57:32 -0500
commit7ebd25fbaeffff77450b3711bb1dee77a0e206d3 (patch)
tree46a2c777f9dbdabf0783db7cf9df82f87e52ca8c
parentf09720e47c0d7396d6c379594b6422ae1b3cab5f (diff)
downloadhomebrew-7ebd25fbaeffff77450b3711bb1dee77a0e206d3.tar.bz2
Stop recording the fails_with cause internally
The string passed as the cause is currently unused, so we don't need to actually store it.
-rw-r--r--Library/Homebrew/compilers.rb31
1 files changed, 13 insertions, 18 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index c3908adec..983e23ef9 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -5,12 +5,15 @@ end
class CompilerFailure
attr_reader :name
- attr_rw :cause, :version
+ attr_rw :version
# Allows Apple compiler `fails_with` statements to keep using `build`
# even though `build` and `version` are the same internally
alias_method :build, :version
+ # The cause is no longer used so we need not hold a reference to the string
+ def cause(_); end
+
def self.for_standard standard
COLLECTIONS.fetch(standard) do
raise ArgumentError, "\"#{standard}\" is not a recognized standard"
@@ -45,26 +48,18 @@ class CompilerFailure
"#<#{self.class.name}: #{name} #{version}>"
end
- MESSAGES = {
- :cxx11 => "This compiler does not support C++11"
- }
-
- cxx11 = proc { cause MESSAGES[:cxx11] }
-
COLLECTIONS = {
:cxx11 => [
- create(:gcc_4_0, &cxx11),
- create(:gcc, &cxx11),
- create(:llvm, &cxx11),
- create(:clang) { build 425; cause MESSAGES[:cxx11] },
- create(:gcc => "4.3", &cxx11),
- create(:gcc => "4.4", &cxx11),
- create(:gcc => "4.5", &cxx11),
- create(:gcc => "4.6", &cxx11),
+ create(:gcc_4_0),
+ create(:gcc),
+ create(:llvm),
+ create(:clang) { build 425 },
+ create(:gcc => "4.3"),
+ create(:gcc => "4.4"),
+ create(:gcc => "4.5"),
+ create(:gcc => "4.6"),
],
- :openmp => [
- create(:clang) { cause "clang does not support OpenMP" },
- ]
+ :openmp => [create(:clang)],
}
end