mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
fix(xlswriter): fix macOS build with modern Clang (C23) (#1086)
This commit is contained in:
@@ -7,6 +7,7 @@ namespace SPC\builder\extension;
|
|||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\store\SourcePatcher;
|
use SPC\store\SourcePatcher;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
use SPC\util\GlobalEnvManager;
|
||||||
|
|
||||||
#[CustomExt('xlswriter')]
|
#[CustomExt('xlswriter')]
|
||||||
class xlswriter extends Extension
|
class xlswriter extends Extension
|
||||||
@@ -28,6 +29,13 @@ class xlswriter extends Extension
|
|||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
$patched = parent::patchBeforeMake();
|
$patched = parent::patchBeforeMake();
|
||||||
|
|
||||||
|
// Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
|
||||||
|
if (PHP_OS_FAMILY !== 'Windows') {
|
||||||
|
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -std=gnu17');
|
||||||
|
$patched = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (PHP_OS_FAMILY === 'Windows') {
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
// fix windows build with openssl extension duplicate symbol bug
|
// fix windows build with openssl extension duplicate symbol bug
|
||||||
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->source_dir);
|
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->source_dir);
|
||||||
@@ -40,4 +48,10 @@ class xlswriter extends Extension
|
|||||||
}
|
}
|
||||||
return $patched;
|
return $patched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
|
||||||
|
protected function getExtraEnv(): array
|
||||||
|
{
|
||||||
|
return ['CFLAGS' => '-std=gnu17'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user