aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compilers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/compilers.rb')
-rw-r--r--Library/Homebrew/compilers.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index e670c9167..f12d9f2ff 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -108,11 +108,11 @@ class CompilerSelector
when :gnu
GNU_GCC_VERSIONS.reverse_each do |v|
name = "gcc-#{v}"
- version = versions.non_apple_gcc_version(name)
+ version = compiler_version(name)
yield Compiler.new(name, version) if version
end
else
- version = versions.send("#{compiler}_build_version")
+ version = compiler_version(compiler)
yield Compiler.new(compiler, version) if version
end
end
@@ -121,4 +121,13 @@ class CompilerSelector
def fails_with?(compiler)
failures.any? { |failure| failure === compiler }
end
+
+ def compiler_version(name)
+ case name
+ when GNU_GCC_REGEXP
+ versions.non_apple_gcc_version(name)
+ else
+ versions.send("#{name}_build_version")
+ end
+ end
end