Add PHP_BUILD_COMPILER for different toolchain

This commit is contained in:
crazywhalecc
2025-08-01 12:48:48 +08:00
parent 34edb6e329
commit 8b9b72958e
7 changed files with 59 additions and 2 deletions

View File

@@ -61,6 +61,10 @@ class ToolchainManager
}
$toolchain = getenv('SPC_TOOLCHAIN');
/* @var ToolchainInterface $toolchain */
(new $toolchain())->afterInit();
$instance = new $toolchain();
$instance->afterInit();
if (getenv('PHP_BUILD_COMPILER') === false && ($compiler_info = $instance->getCompilerInfo())) {
GlobalEnvManager::putenv("PHP_BUILD_COMPILER={$compiler_info}");
}
}
}