Add linux-only for extra runtime objects

This commit is contained in:
crazywhalecc 2025-07-05 11:42:00 +08:00
parent c9d33bffc8
commit 112f607d6e
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -217,7 +217,11 @@ class Extension
*/
public function patchBeforeSharedMake(): bool
{
if (ToolchainManager::getToolchainClass() === ZigToolchain::class && ($extra = (new ZigToolchain())->getExtraRuntimeObjects())) {
if (
PHP_OS_FAMILY === 'Linux' &&
ToolchainManager::getToolchainClass() === ZigToolchain::class &&
($extra = (new ZigToolchain())->getExtraRuntimeObjects())
) {
FileSystem::replaceFileRegex(
$this->source_dir . '/Makefile',
"/^(shared_objects_{$this->getName()}\\s*=.*)$/m",