Class: CompilerSelector Private
- Inherits:
-
Object
- Object
- CompilerSelector
- Defined in:
- Library/Homebrew/compilers.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class for selecting a compiler for a formula.
Defined Under Namespace
Classes: Compiler
Constant Summary collapse
- COMPILER_PRIORITY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ clang: [:clang, :gnu, :llvm_clang], gcc: [:gnu, :gcc, :llvm_clang, :clang], }.freeze
Instance Attribute Summary collapse
- #compilers ⇒ Object readonly private
- #failures ⇒ Object readonly private
- #formula ⇒ Object readonly private
- #versions ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #compiler ⇒ Object private
-
#initialize(formula, versions, compilers) ⇒ CompilerSelector
constructor
private
A new instance of CompilerSelector.
Constructor Details
#initialize(formula, versions, compilers) ⇒ CompilerSelector
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of CompilerSelector.
100 101 102 103 104 105 |
# File 'Library/Homebrew/compilers.rb', line 100 def initialize(formula, versions, compilers) @formula = formula @failures = formula.compiler_failures @versions = versions @compilers = compilers end |
Instance Attribute Details
#compilers ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'Library/Homebrew/compilers.rb', line 98 def compilers @compilers end |
#failures ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'Library/Homebrew/compilers.rb', line 98 def failures @failures end |
#formula ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'Library/Homebrew/compilers.rb', line 98 def formula @formula end |
#versions ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'Library/Homebrew/compilers.rb', line 98 def versions @versions end |
Class Method Details
.compilers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
94 95 96 |
# File 'Library/Homebrew/compilers.rb', line 94 def self.compilers COMPILER_PRIORITY.fetch(DevelopmentTools.default_compiler) end |
.select_for(formula, compilers = self.compilers) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
90 91 92 |
# File 'Library/Homebrew/compilers.rb', line 90 def self.select_for(formula, compilers = self.compilers) new(formula, DevelopmentTools, compilers).compiler end |
Instance Method Details
#compiler ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
107 108 109 110 |
# File 'Library/Homebrew/compilers.rb', line 107 def compiler find_compiler { |c| return c.name unless fails_with?(c) } raise CompilerSelectionError, formula end |