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