Skip to content

Commit ef30257

Browse files
committed
fix gcc compiler version
1 parent b5fa7be commit ef30257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SPC/toolchain/GccNativeToolchain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getCompilerInfo(): ?string
4242
$compiler = getenv('CC') ?: 'gcc';
4343
$version = shell(false)->execWithResult("{$compiler} --version", false);
4444
$head = pathinfo($compiler, PATHINFO_BASENAME);
45-
if ($version[0] === 0 && preg_match('/gcc.*(\d+.\d+.\d+)/', $version[1][0], $match)) {
45+
if ($version[0] === 0 && preg_match('/gcc.*?(\d+\.\d+\.\d+)/', $version[1][0], $match)) {
4646
return "{$head} {$match[1]}";
4747
}
4848
return $head;

0 commit comments

Comments
 (0)