mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
24 lines
561 B
PHP
24 lines
561 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\extension;
|
||
|
|
|
||
|
|
use SPC\builder\Extension;
|
||
|
|
use SPC\util\CustomExt;
|
||
|
|
|
||
|
|
#[CustomExt('iconv')]
|
||
|
|
class iconv extends Extension
|
||
|
|
{
|
||
|
|
public function patchBeforeConfigure(): bool
|
||
|
|
{
|
||
|
|
// macOS need to link iconv dynamically, we add it to extra-libs
|
||
|
|
$extra_libs = $this->builder->getOption('extra-libs', '');
|
||
|
|
if (!str_contains($extra_libs, '-liconv')) {
|
||
|
|
$extra_libs .= ' -liconv';
|
||
|
|
}
|
||
|
|
$this->builder->setOption('extra-libs', $extra_libs);
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|