mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 15:25:36 +08:00
patch libxml2 for zig
This commit is contained in:
@@ -6,10 +6,30 @@ namespace SPC\builder\unix\library;
|
|||||||
|
|
||||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\toolchain\ToolchainManager;
|
||||||
|
use SPC\toolchain\ZigToolchain;
|
||||||
use SPC\util\executor\UnixCMakeExecutor;
|
use SPC\util\executor\UnixCMakeExecutor;
|
||||||
|
|
||||||
trait libxml2
|
trait libxml2
|
||||||
{
|
{
|
||||||
|
public function patchBeforeBuild(): bool
|
||||||
|
{
|
||||||
|
if (ToolchainManager::getToolchainClass() !== ZigToolchain::class) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$patched = (bool) FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/configure.ac',
|
||||||
|
'AX_APPEND_FLAG([-Wl,--version-script=], [VERSION_SCRIPT_FLAGS])',
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
$patched = $patched || FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/CMakeLists.txt',
|
||||||
|
'target_link_options(LibXml2 PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")',
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
return $patched;
|
||||||
|
}
|
||||||
|
|
||||||
public function build(): void
|
public function build(): void
|
||||||
{
|
{
|
||||||
$cmake = UnixCMakeExecutor::create($this)
|
$cmake = UnixCMakeExecutor::create($this)
|
||||||
|
|||||||
Reference in New Issue
Block a user