Remove the universal accessor from BuildOptions
BuildOptions is now immutable (finally).
This commit is contained in:
parent
cb7b9945cd
commit
e6498f4dfc
@ -1,6 +1,4 @@
|
|||||||
class BuildOptions
|
class BuildOptions
|
||||||
attr_accessor :universal
|
|
||||||
|
|
||||||
def initialize(args, options)
|
def initialize(args, options)
|
||||||
@args = args
|
@args = args
|
||||||
@options = options
|
@options = options
|
||||||
@ -48,7 +46,7 @@ class BuildOptions
|
|||||||
|
|
||||||
# True if the user requested a universal build.
|
# True if the user requested a universal build.
|
||||||
def universal?
|
def universal?
|
||||||
universal || include?("universal") && option_defined?("universal")
|
include?("universal") && option_defined?("universal")
|
||||||
end
|
end
|
||||||
|
|
||||||
# True if the user requested to enable C++11 mode.
|
# True if the user requested to enable C++11 mode.
|
||||||
|
@ -43,4 +43,8 @@ class Formula
|
|||||||
def self.factory(name)
|
def self.factory(name)
|
||||||
Formulary.factory(name)
|
Formulary.factory(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.require_universal_deps
|
||||||
|
define_method(:require_universal_deps?) { true }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -248,6 +248,10 @@ class Formula
|
|||||||
self.class.cxxstdlib.include?(:skip)
|
self.class.cxxstdlib.include?(:skip)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def require_universal_deps?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
# yields self with current working directory set to the uncompressed tarball
|
# yields self with current working directory set to the uncompressed tarball
|
||||||
def brew
|
def brew
|
||||||
validate_attributes :name, :version
|
validate_attributes :name, :version
|
||||||
@ -759,10 +763,6 @@ class Formula
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_universal_deps
|
|
||||||
specs.each { |spec| spec.build.universal = true }
|
|
||||||
end
|
|
||||||
|
|
||||||
def test &block
|
def test &block
|
||||||
return @test unless block_given?
|
return @test unless block_given?
|
||||||
@test_defined = true
|
@test_defined = true
|
||||||
|
@ -310,7 +310,7 @@ class FormulaInstaller
|
|||||||
def inherited_options_for(dep)
|
def inherited_options_for(dep)
|
||||||
inherited_options = Options.new
|
inherited_options = Options.new
|
||||||
u = Option.new("universal")
|
u = Option.new("universal")
|
||||||
if (options.include?(u) || f.build.universal?) && !dep.build? && dep.to_formula.option_defined?(u)
|
if (options.include?(u) || f.require_universal_deps?) && !dep.build? && dep.to_formula.option_defined?(u)
|
||||||
inherited_options << u
|
inherited_options << u
|
||||||
end
|
end
|
||||||
inherited_options
|
inherited_options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user