Class: CompilerSelector Private
- Includes:
- CompilerConstants
- 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
Constants included from CompilerConstants
CompilerConstants::COMPILERS, CompilerConstants::COMPILER_SYMBOL_MAP, CompilerConstants::GNU_GCC_REGEXP, CompilerConstants::GNU_GCC_VERSIONS
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 private
- .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.
119 120 121 122 123 124 |
# File 'compilers.rb', line 119 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.
117 118 119 |
# File 'compilers.rb', line 117 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.
117 118 119 |
# File 'compilers.rb', line 117 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.
117 118 119 |
# File 'compilers.rb', line 117 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.
117 118 119 |
# File 'compilers.rb', line 117 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.
113 114 115 |
# File 'compilers.rb', line 113 def self.compilers COMPILER_PRIORITY.fetch(DevelopmentTools.default_compiler) end |
.preferred_gcc ⇒ String
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.
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.
109 110 111 |
# File 'compilers.rb', line 109 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.
126 127 128 129 |
# File 'compilers.rb', line 126 def compiler find_compiler { |c| return c.name unless fails_with?(c) } raise CompilerSelectionError, formula end |