Fix windows builds when unix configure does not exist

This commit is contained in:
crazywhalecc 2025-07-30 23:57:52 +08:00
parent 357c04def0
commit 5f33a07f4c
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,9 @@ class bz2 extends Extension
*/
public function patchBeforeConfigure(): bool
{
if (!is_unix()) {
return false;
}
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lbz2/', $this->getLibFilesString() . $frameworks);
return true;

View File

@ -98,7 +98,9 @@ class SourcePatcher
}
}
// patch capstone
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/have_capstone="yes"/', 'have_capstone="no"');
if (is_unix()) {
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/have_capstone="yes"/', 'have_capstone="no"');
}
}
/**