diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 40bfe68c..517f6c10 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -156,6 +156,7 @@ class CompilerBase extends \PhpAot\Core\Translator protected int $maxJob = 4; protected string $buildMode = 'bin'; protected string $cxxflags = ''; + protected string $cxxStd = 'c++14'; protected string $ldflags = ''; protected int $floatPrecision = 17; protected bool $debugInfo = false; @@ -2110,6 +2111,9 @@ class CompilerBase extends \PhpAot\Core\Translator if ($this->cxxflags) { $cmd .= ' ' . $this->cxxflags; } + if (!str_contains($this->cxxflags, ' -std=')) { + $cmd .= ' -std=' . $this->cxxStd; + } } }