mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
patch libxml2 for zig
This commit is contained in:
parent
3d4b87b107
commit
c3825a356b
@ -6,10 +6,30 @@ namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\toolchain\ToolchainManager;
|
||||
use SPC\toolchain\ZigToolchain;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
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
|
||||
{
|
||||
$cmake = UnixCMakeExecutor::create($this)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user