From 518ed3a7fd19d23ad489ad4723f23736b7a11195 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 11 Jun 2025 15:38:43 +0700 Subject: [PATCH] don't add -lomp on macos (not required) --- src/SPC/builder/extension/imagick.php | 11 +++++------ src/SPC/util/SPCConfigUtil.php | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index 4bd4ddcc..d78627ef 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -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; } diff --git a/src/SPC/util/SPCConfigUtil.php b/src/SPC/util/SPCConfigUtil.php index da52d3b8..375d40cd 100644 --- a/src/SPC/util/SPCConfigUtil.php +++ b/src/SPC/util/SPCConfigUtil.php @@ -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); }