Support GCC 10

This commit is contained in:
Trung Le 2020-05-01 00:59:08 +10:00
parent a4eb7e73f4
commit 420fcfca0e
2 changed files with 3 additions and 3 deletions

View File

@ -2,8 +2,8 @@
# @private
module CompilerConstants
GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9].freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9])$/.freeze
GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10].freeze
GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10)$/.freeze
COMPILER_SYMBOL_MAP = {
"gcc" => :gcc,
"clang" => :clang,

View File

@ -78,7 +78,7 @@ class DevelopmentTools
path = HOMEBREW_PREFIX/"opt/gcc/bin"/cc
path = locate(cc) unless path.exist?
version = if path &&
build_version = `#{path} --version`[/gcc(?:(?:-\d(?:\.\d)?)? \(.+\))? (\d\.\d\.\d)/, 1]
build_version = `#{path} --version`[/gcc(?:(?:-\d(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1]
Version.new build_version
else
Version::NULL