File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/SPC/builder/extension Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 77use SPC \builder \Extension ;
88use SPC \store \SourcePatcher ;
99use SPC \util \CustomExt ;
10+ use SPC \util \GlobalEnvManager ;
1011
1112#[CustomExt('xlswriter ' )]
1213class xlswriter extends Extension
@@ -28,6 +29,13 @@ public function getWindowsConfigureArg(bool $shared = false): string
2829 public function patchBeforeMake (): bool
2930 {
3031 $ patched = parent ::patchBeforeMake ();
32+
33+ // Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
34+ if (PHP_OS_FAMILY !== 'Windows ' ) {
35+ GlobalEnvManager::putenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS= ' . getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS ' ) . ' -std=gnu17 ' );
36+ $ patched = true ;
37+ }
38+
3139 if (PHP_OS_FAMILY === 'Windows ' ) {
3240 // fix windows build with openssl extension duplicate symbol bug
3341 SourcePatcher::patchFile ('spc_fix_xlswriter_win32.patch ' , $ this ->source_dir );
@@ -40,4 +48,10 @@ public function patchBeforeMake(): bool
4048 }
4149 return $ patched ;
4250 }
51+
52+ // Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
53+ protected function getExtraEnv (): array
54+ {
55+ return ['CFLAGS ' => '-std=gnu17 ' ];
56+ }
4357}
You can’t perform that action at this time.
0 commit comments