Skip to content

Commit 832c023

Browse files
committed
getcctype default
1 parent e1028b0 commit 832c023

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/SPC/builder/extension/imagick.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ protected function getStaticAndSharedLibs(): array
3838
$static .= ' -lstdc++';
3939
$shared = str_replace('-lstdc++', '', $shared);
4040
}
41-
if (str_contains(getenv('CC'), 'zig')) {
42-
$shared = str_replace('-lomp', '/usr/lib64/libomp.so', $shared);
43-
}
4441
return [$static, $shared];
4542
}
4643
}

src/SPC/builder/linux/SystemUtil.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ public static function getCpuCount(): int
7878
/**
7979
* @throws RuntimeException
8080
*/
81-
public static function getCCType(string $cc): string
81+
public static function getCCType(?string $cc = null): string
8282
{
83+
$cc ??= getenv('CC');
8384
return match (true) {
8485
str_contains($cc, 'zig') => 'clang',
8586
str_ends_with($cc, 'c++'), str_ends_with($cc, 'cc'), str_ends_with($cc, 'g++'), str_ends_with($cc, 'gcc') => 'gcc',

src/SPC/builder/linux/library/openssl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function build(): void
6262

6363
$ex_lib = trim($ex_lib);
6464

65-
$clang_postfix = SystemUtil::getCCType(getenv('CC')) === 'clang' ? '-clang' : '';
65+
$clang_postfix = SystemUtil::getCCType() === 'clang' ? '-clang' : '';
6666

6767
shell()->cd($this->source_dir)->initializeEnv($this)
6868
->exec(

src/SPC/util/SPCConfigUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function config(array $extensions = [], array $libraries = [], bool $incl
7171
if ($this->builder->hasCpp()) {
7272
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
7373
}
74-
if (SystemUtil::getCCType(getenv('CC')) === 'clang') {
74+
if (SystemUtil::getCCType() === 'clang') {
7575
$libs .= ' -lunwind';
7676
}
7777
// mimalloc must come first

0 commit comments

Comments
 (0)