fix macOS build libpng error with old option mode

This commit is contained in:
crazywhalecc 2024-04-07 16:35:41 +08:00 committed by Jerry Ma
parent 3a2683bb0c
commit 4d227ca7ef

View File

@ -35,7 +35,7 @@ class libpng extends MacOSLibraryBase
*/
protected function build(): void
{
$optimizations = match ($this->builder->getOption('arch')) {
$optimizations = match (php_uname('m')) {
'x86_64' => '--enable-intel-sse ',
'arm64' => '--enable-arm-neon ',
default => '',
@ -45,7 +45,7 @@ class libpng extends MacOSLibraryBase
->exec('chmod +x ./install-sh')
->exec(
'./configure ' .
"--host={$this->builder->getOption('gnu-arch')}-apple-darwin " .
'--host=' . arch2gnu(php_uname('m')) . '-apple-darwin ' .
'--disable-shared ' .
'--enable-static ' .
'--enable-hardware-optimizations ' .