mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 11:25:35 +08:00
getcctype default
This commit is contained in:
@@ -38,9 +38,6 @@ class imagick extends Extension
|
|||||||
$static .= ' -lstdc++';
|
$static .= ' -lstdc++';
|
||||||
$shared = str_replace('-lstdc++', '', $shared);
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
}
|
}
|
||||||
if (str_contains(getenv('CC'), 'zig')) {
|
|
||||||
$shared = str_replace('-lomp', '/usr/lib64/libomp.so', $shared);
|
|
||||||
}
|
|
||||||
return [$static, $shared];
|
return [$static, $shared];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,9 @@ class SystemUtil
|
|||||||
/**
|
/**
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
public static function getCCType(string $cc): string
|
public static function getCCType(?string $cc = null): string
|
||||||
{
|
{
|
||||||
|
$cc ??= getenv('CC');
|
||||||
return match (true) {
|
return match (true) {
|
||||||
str_contains($cc, 'zig') => 'clang',
|
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',
|
str_ends_with($cc, 'c++'), str_ends_with($cc, 'cc'), str_ends_with($cc, 'g++'), str_ends_with($cc, 'gcc') => 'gcc',
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class openssl extends LinuxLibraryBase
|
|||||||
|
|
||||||
$ex_lib = trim($ex_lib);
|
$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)
|
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||||
->exec(
|
->exec(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class SPCConfigUtil
|
|||||||
if ($this->builder->hasCpp()) {
|
if ($this->builder->hasCpp()) {
|
||||||
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
|
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
|
||||||
}
|
}
|
||||||
if (SystemUtil::getCCType(getenv('CC')) === 'clang') {
|
if (SystemUtil::getCCType() === 'clang') {
|
||||||
$libs .= ' -lunwind';
|
$libs .= ' -lunwind';
|
||||||
}
|
}
|
||||||
// mimalloc must come first
|
// mimalloc must come first
|
||||||
|
|||||||
Reference in New Issue
Block a user