mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 10:25:36 +08:00
Make intl use c++17
This commit is contained in:
@@ -16,7 +16,7 @@ use StaticPHP\Util\FileSystem;
|
|||||||
class intl extends PhpExtensionPackage
|
class intl extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-intl')]
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-intl')]
|
||||||
#[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support')]
|
#[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support; add /std:c++17 required by ICU 73+')]
|
||||||
public function patchBeforeBuildconfForWindows(PackageInstaller $installer): void
|
public function patchBeforeBuildconfForWindows(PackageInstaller $installer): void
|
||||||
{
|
{
|
||||||
$php_src = $installer->getTargetPackage('php')->getSourceDir();
|
$php_src = $installer->getTargetPackage('php')->getSourceDir();
|
||||||
@@ -25,5 +25,11 @@ class intl extends PhpExtensionPackage
|
|||||||
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,',
|
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,',
|
||||||
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,'
|
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,'
|
||||||
);
|
);
|
||||||
|
// ICU 73+ headers (char16ptr.h etc.) unconditionally include <string_view> which requires C++17.
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$php_src}/ext/intl/config.w32",
|
||||||
|
'ADD_FLAG("CFLAGS_INTL", "/EHsc',
|
||||||
|
'ADD_FLAG("CFLAGS_INTL", "/std:c++17 /EHsc'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user