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.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index b871e1aeb..37ce6cdb2 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -53,11 +53,18 @@ class CompilerSelector
end
end
+ # Attempts to select an appropriate alternate compiler, but
+ # if none can be found raises CompilerError instead
def compiler
begin
cc = @compilers.pop
end while @f.fails_with?(cc)
- cc.nil? ? @old_compiler : cc.name
+
+ if cc.nil?
+ raise CompilerSelectionError
+ else
+ cc.name
+ end
end
private