fix gcc compiler version

This commit is contained in:
DubbleClick 2025-08-25 09:29:06 +07:00
parent b5fa7be53f
commit ef3025798d

View File

@ -42,7 +42,7 @@ class GccNativeToolchain implements ToolchainInterface
$compiler = getenv('CC') ?: 'gcc';
$version = shell(false)->execWithResult("{$compiler} --version", false);
$head = pathinfo($compiler, PATHINFO_BASENAME);
if ($version[0] === 0 && preg_match('/gcc.*(\d+.\d+.\d+)/', $version[1][0], $match)) {
if ($version[0] === 0 && preg_match('/gcc.*?(\d+\.\d+\.\d+)/', $version[1][0], $match)) {
return "{$head} {$match[1]}";
}
return $head;