Skip to content
Snippets Groups Projects
Commit b6e9600b authored by Jack Nagel's avatar Jack Nagel
Browse files

Eliminate consideration of major_version

The major version is implicit in the compiler name. Since the name is
used when matching failures to compilers, we don't need to consider the
major version separately.
parent 4580d868
Branches
Tags
No related merge requests found
......@@ -3,13 +3,7 @@ module CompilerConstants
GNU_GCC_REGEXP = /^gcc-(4\.[3-9])$/
end
class Compiler < Struct.new(:name, :version, :priority)
# The major version for non-Apple compilers. Used to indicate a compiler
# series; for instance, if the version is 4.8.2, it would return "4.8".
def major_version
version.match(/(\d\.\d)/)[0] if name.is_a? String
end
end
Compiler = Struct.new(:name, :version, :priority)
class CompilerFailure
attr_reader :name
......@@ -32,12 +26,11 @@ class CompilerFailure
name = "gcc-#{major_version}"
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
version = "#{major_version}.999"
GnuCompilerFailure.new(name, major_version, version, &block)
else
name = spec
version = 9999
new(name, version, &block)
end
new(name, version, &block)
end
def initialize(name, version, &block)
......@@ -50,19 +43,6 @@ class CompilerFailure
name == compiler.name && version >= (compiler.version || 0)
end
class GnuCompilerFailure < CompilerFailure
attr_reader :major_version
def initialize(name, major_version, version, &block)
@major_version = major_version
super(name, version, &block)
end
def ===(compiler)
super && major_version == compiler.major_version
end
end
MESSAGES = {
:cxx11 => "This compiler does not support C++11"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment