Class: CompilerSelector Private
- Defined in:
- extend/os/linux/compilers.rb,
compilers.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
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. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
{ 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
-
.compilers ⇒ Object
private
-
.preferred_gcc ⇒ String
-
.select_for(formula, compilers = self.compilers) ⇒ Object
private
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. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of CompilerSelector.
122 123 124 125 126 127 |
# File 'compilers.rb', line 122 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. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
120 121 122 |
# File 'compilers.rb', line 120 def compilers @compilers end |
#failures ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
120 121 122 |
# File 'compilers.rb', line 120 def failures @failures end |
#formula ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
120 121 122 |
# File 'compilers.rb', line 120 def formula @formula end |
#versions ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
120 121 122 |
# File 'compilers.rb', line 120 def versions @versions end |
Class Method Details
.compilers ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
116 117 118 |
# File 'compilers.rb', line 116 def self.compilers COMPILER_PRIORITY.fetch(DevelopmentTools.default_compiler) end |
.preferred_gcc ⇒ String
6 7 8 |
# File 'extend/os/linux/compilers.rb', line 6 def self.preferred_gcc OS::LINUX_PREFERRED_GCC_COMPILER_FORMULA end |
.select_for(formula, compilers = self.compilers) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
112 113 114 |
# File 'compilers.rb', line 112 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. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
129 130 131 132 |
# File 'compilers.rb', line 129 def compiler find_compiler { |c| return c.name unless fails_with?(c) } raise CompilerSelectionError, formula end |