From 420fcfca0ea0f989cf1266b5d3e5c63e13e6a3a6 Mon Sep 17 00:00:00 2001 From: Trung Le Date: Fri, 1 May 2020 00:59:08 +1000 Subject: [PATCH] Support GCC 10 --- Library/Homebrew/compilers.rb | 4 ++-- Library/Homebrew/development_tools.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 761700b17c..7f95f25b83 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -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, diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index aed19cc8d7..456a156871 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -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