Skip to content

Commit 6b5aaa3

Browse files
authored
Merge pull request #857 from crazywhalecc/fix/lstdcpp
move -lstdc++ to the end of the libraries
2 parents cbddb26 + 4e95452 commit 6b5aaa3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SPC/builder/extension/redis.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ public function getUnixConfigureArg(bool $shared = false): string
1616
if ($this->isBuildStatic()) {
1717
$arg .= $this->builder->getExt('session')?->isBuildStatic() ? ' --enable-redis-session' : ' --disable-redis-session';
1818
$arg .= $this->builder->getExt('igbinary')?->isBuildStatic() ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
19+
$arg .= $this->builder->getExt('msgpack')?->isBuildStatic() ? ' --enable-redis-msgpack' : ' --disable-redis-msgpack';
1920
} else {
2021
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
2122
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
23+
$arg .= $this->builder->getExt('msgpack') ? ' --enable-redis-msgpack' : ' --disable-redis-msgpack';
2224
}
2325
if ($this->builder->getLib('zstd')) {
2426
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';

src/SPC/util/SPCConfigUtil.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ public function config(array $extensions = [], array $libraries = [], bool $incl
8080
}
8181
if ($this->builder->hasCpp()) {
8282
$libcpp = SPCTarget::getTargetOS() === 'Darwin' ? '-lc++' : '-lstdc++';
83-
if (!str_contains($libs, $libcpp)) {
84-
$libs .= " {$libcpp}";
85-
}
83+
$libs = str_replace($libcpp, '', $libs) . " {$libcpp}";
8684
}
8785

8886
if ($this->libs_only_deps) {

0 commit comments

Comments
 (0)