aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compilers.rb
diff options
context:
space:
mode:
authorJack Nagel2014-09-21 00:53:15 -0500
committerJack Nagel2014-09-21 00:57:32 -0500
commit3de77e4e1a30b404a9546a1f27fb06db76b591e8 (patch)
treec5256bd0fd7be79ebf683daa95ced163db4628f3 /Library/Homebrew/compilers.rb
parente582d2c87eb4a105f1db6a4a543e1ef28cd1dc2d (diff)
downloadbrew-3de77e4e1a30b404a9546a1f27fb06db76b591e8.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.
Diffstat (limited to 'Library/Homebrew/compilers.rb')
-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