getcctype default

This commit is contained in:
DubbleClick
2025-06-24 21:03:32 +07:00
parent e1028b0348
commit 832c0230e2
4 changed files with 4 additions and 6 deletions

View File

@@ -78,8 +78,9 @@ class SystemUtil
/**
* @throws RuntimeException
*/
public static function getCCType(string $cc): string
public static function getCCType(?string $cc = null): string
{
$cc ??= getenv('CC');
return match (true) {
str_contains($cc, 'zig') => 'clang',
str_ends_with($cc, 'c++'), str_ends_with($cc, 'cc'), str_ends_with($cc, 'g++'), str_ends_with($cc, 'gcc') => 'gcc',

View File

@@ -62,7 +62,7 @@ class openssl extends LinuxLibraryBase
$ex_lib = trim($ex_lib);
$clang_postfix = SystemUtil::getCCType(getenv('CC')) === 'clang' ? '-clang' : '';
$clang_postfix = SystemUtil::getCCType() === 'clang' ? '-clang' : '';
shell()->cd($this->source_dir)->initializeEnv($this)
->exec(