move pgo from new to static creation method

This commit is contained in:
henderkes
2026-04-30 19:46:07 +07:00
parent 5293f76eaf
commit 814d3cba58
3 changed files with 66 additions and 67 deletions

View File

@@ -23,6 +23,8 @@ class LinuxBuilder extends UnixBuilderBase
/** @var bool Micro patch phar flag */
private bool $phar_patched = false;
private ?PgoManager $pgo = null;
public function __construct(array $options = [])
{
$this->options = $options;
@@ -49,6 +51,8 @@ class LinuxBuilder extends UnixBuilderBase
*/
public function buildPHP(int $build_target = BUILD_TARGET_NONE): void
{
$this->pgo = PgoManager::fromBuilder($this, $build_target);
$cflags = $this->arch_c_flags;
f_putenv('CFLAGS=' . $cflags);
@@ -134,7 +138,7 @@ class LinuxBuilder extends UnixBuilderBase
$this->cleanMake();
$pgo = PgoManager::active();
$pgo = $this->pgo;
$needsClean = false;
$sapiBuilds = [
['cli', $enableCli, true, fn () => $this->buildCli()],