mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-21 07:45:36 +08:00
don't add -lomp on macos (not required)
This commit is contained in:
@@ -12,15 +12,14 @@ class imagick extends Extension
|
|||||||
{
|
{
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
if (PHP_OS_FAMILY !== 'Linux') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// imagick with calls omp_pause_all which requires openmp, on non-musl we build imagick without openmp
|
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
|
||||||
$extra_libs = match (PHP_OS_FAMILY) {
|
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp');
|
||||||
'Linux' => trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp'),
|
|
||||||
'Darwin' => trim(getenv('SPC_EXTRA_LIBS') . ' -lomp'),
|
|
||||||
default => ''
|
|
||||||
};
|
|
||||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,9 +146,6 @@ class SPCConfigUtil
|
|||||||
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
|
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
|
||||||
$short_name[] = '-lgomp';
|
$short_name[] = '-lgomp';
|
||||||
}
|
}
|
||||||
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Darwin') {
|
|
||||||
$short_name[] = '-lomp';
|
|
||||||
}
|
|
||||||
return implode(' ', $short_name);
|
return implode(' ', $short_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user