Move compiler failure matching logic into failure object
This commit is contained in:
parent
e5d6247ae7
commit
8e8b9acc01
@ -48,6 +48,12 @@ class CompilerFailure
|
|||||||
instance_eval(&block) if block_given?
|
instance_eval(&block) if block_given?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ===(compiler)
|
||||||
|
name == compiler.name &&
|
||||||
|
major_version == compiler.major_version &&
|
||||||
|
version >= (compiler.version || 0)
|
||||||
|
end
|
||||||
|
|
||||||
MESSAGES = {
|
MESSAGES = {
|
||||||
:cxx11 => "This compiler does not support C++11"
|
:cxx11 => "This compiler does not support C++11"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -231,13 +231,8 @@ class Formula
|
|||||||
self.class.keg_only_reason
|
self.class.keg_only_reason
|
||||||
end
|
end
|
||||||
|
|
||||||
def fails_with? cc
|
def fails_with? compiler
|
||||||
(self.class.cc_failures || []).any? do |failure|
|
(self.class.cc_failures || []).any? { |failure| failure === compiler }
|
||||||
# Major version check distinguishes between, e.g.,
|
|
||||||
# GCC 4.7.1 and GCC 4.8.2, where a comparison is meaningless
|
|
||||||
failure.name == cc.name && failure.major_version == cc.major_version &&
|
|
||||||
failure.version >= (cc.version || 0)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# sometimes the formula cleaner breaks things
|
# sometimes the formula cleaner breaks things
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user