From dfd7b59d9894167a7b57a040009056bfd10d00d3 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Wed, 7 Jan 2026 21:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlinux=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8B=20=E9=9D=9E=E5=AE=B9=E5=99=A8=E7=8E=AF=E5=A2=83=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/prepare.php b/prepare.php index 1e65a07d55..af37e96761 100755 --- a/prepare.php +++ b/prepare.php @@ -31,7 +31,7 @@ } // Compile directly on the host machine, not in the docker container -if ($p->getInputOption('without-docker') || ($p->isMacos())) { +if ($p->getInputOption('without-docker') || ($p->isMacos()) || ($p->isLinux() && (!is_file('/.dockerenv')))) { $p->setWorkDir(__DIR__); $p->setBuildDir(__DIR__ . '/thirdparty'); } @@ -46,7 +46,12 @@ if ($p->isMacos()) { $p->setExtraLdflags(''); - $homebrew_prefix = trim(shell_exec('brew --prefix')); + exec("brew --prefix 2>&1", $output, $result_code); + if ($result_code == 0) { + $homebrew_prefix = trim(implode(' ', $output)); + } else { + $homebrew_prefix = ""; + } $p->withBinPath($homebrew_prefix . '/opt/flex/bin') ->withBinPath($homebrew_prefix . '/opt/bison/bin') ->withBinPath($homebrew_prefix . '/opt/libtool/bin')