-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use C++ 17 compiler for ICU (#414)
* fix: use C++ 17 compiler for ICU * wip * hack CXX env var to force C++17 * test intl * test intl * add retry for CI test download * patch * separate intl with newer icu c++ patch --------- Co-authored-by: crazywhalecc <[email protected]>
- Loading branch information
1 parent
21dbb8a
commit 6b96feb
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\extension; | ||
|
||
use SPC\builder\Extension; | ||
use SPC\store\FileSystem; | ||
use SPC\util\CustomExt; | ||
|
||
#[CustomExt('intl')] | ||
class intl extends Extension | ||
{ | ||
public function patchBeforeBuildconf(): bool | ||
{ | ||
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released | ||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17'); | ||
// Also need to use clang++ -std=c++17 to force override the default C++ standard | ||
if (is_string($env = getenv('CXX')) && !str_contains($env, 'std=c++17')) { | ||
f_putenv('CXX=' . $env . ' -std=c++17'); | ||
} else { | ||
f_putenv('CXX=clang++ -std=c++17'); | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters