diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index 74a63ebc..16a8fa64 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -38,9 +38,6 @@ class imagick extends Extension $static .= ' -lstdc++'; $shared = str_replace('-lstdc++', '', $shared); } - if (str_contains(getenv('CC'), 'zig')) { - $shared = str_replace('-lomp', '/usr/lib64/libomp.so', $shared); - } return [$static, $shared]; } } diff --git a/src/SPC/builder/linux/SystemUtil.php b/src/SPC/builder/linux/SystemUtil.php index 852ff657..cc751533 100644 --- a/src/SPC/builder/linux/SystemUtil.php +++ b/src/SPC/builder/linux/SystemUtil.php @@ -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', diff --git a/src/SPC/builder/linux/library/openssl.php b/src/SPC/builder/linux/library/openssl.php index 252eb47f..2a36fe81 100644 --- a/src/SPC/builder/linux/library/openssl.php +++ b/src/SPC/builder/linux/library/openssl.php @@ -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( diff --git a/src/SPC/util/SPCConfigUtil.php b/src/SPC/util/SPCConfigUtil.php index e2f18b08..5b7a0d5a 100644 --- a/src/SPC/util/SPCConfigUtil.php +++ b/src/SPC/util/SPCConfigUtil.php @@ -71,7 +71,7 @@ class SPCConfigUtil if ($this->builder->hasCpp()) { $libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++'; } - if (SystemUtil::getCCType(getenv('CC')) === 'clang') { + if (SystemUtil::getCCType() === 'clang') { $libs .= ' -lunwind'; } // mimalloc must come first