Merge pull request #857 from crazywhalecc/fix/lstdcpp

move -lstdc++ to the end of the libraries
This commit is contained in:
Marc 2025-08-19 10:51:28 +02:00 committed by GitHub
commit 6b5aaa38ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -16,9 +16,11 @@ class redis extends Extension
if ($this->isBuildStatic()) {
$arg .= $this->builder->getExt('session')?->isBuildStatic() ? ' --enable-redis-session' : ' --disable-redis-session';
$arg .= $this->builder->getExt('igbinary')?->isBuildStatic() ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
$arg .= $this->builder->getExt('msgpack')?->isBuildStatic() ? ' --enable-redis-msgpack' : ' --disable-redis-msgpack';
} else {
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
$arg .= $this->builder->getExt('msgpack') ? ' --enable-redis-msgpack' : ' --disable-redis-msgpack';
}
if ($this->builder->getLib('zstd')) {
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';

View File

@ -80,9 +80,7 @@ class SPCConfigUtil
}
if ($this->builder->hasCpp()) {
$libcpp = SPCTarget::getTargetOS() === 'Darwin' ? '-lc++' : '-lstdc++';
if (!str_contains($libs, $libcpp)) {
$libs .= " {$libcpp}";
}
$libs = str_replace($libcpp, '', $libs) . " {$libcpp}";
}
if ($this->libs_only_deps) {