don't add -lomp on macos (not required)

This commit is contained in:
DubbleClick 2025-06-11 15:38:43 +07:00
parent d322be1666
commit 518ed3a7fd
2 changed files with 5 additions and 9 deletions

View File

@ -12,15 +12,14 @@ class imagick extends Extension
{
public function patchBeforeMake(): bool
{
if (PHP_OS_FAMILY !== 'Linux') {
return false;
}
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
return false;
}
// imagick with calls omp_pause_all which requires openmp, on non-musl we build imagick without openmp
$extra_libs = match (PHP_OS_FAMILY) {
'Linux' => trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp'),
'Darwin' => trim(getenv('SPC_EXTRA_LIBS') . ' -lomp'),
default => ''
};
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp');
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
return true;
}

View File

@ -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'))) {
$short_name[] = '-lgomp';
}
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Darwin') {
$short_name[] = '-lomp';
}
return implode(' ', $short_name);
}