From ed8837fe9f151d90c32f5e6b65950ce368be8f55 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 31 Oct 2023 00:59:22 +0800 Subject: [PATCH] let postgresql use -lc++ in bsd and macos --- src/SPC/builder/unix/library/postgresql.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/library/postgresql.php b/src/SPC/builder/unix/library/postgresql.php index 235e40f0..38be1bf2 100644 --- a/src/SPC/builder/unix/library/postgresql.php +++ b/src/SPC/builder/unix/library/postgresql.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace SPC\builder\unix\library; +use SPC\builder\linux\library\LinuxLibraryBase; use SPC\builder\macos\library\MacOSLibraryBase; use SPC\exception\FileSystemException; use SPC\exception\RuntimeException; @@ -46,7 +47,11 @@ trait postgresql $output = shell()->execWithResult("pkg-config --libs-only-l --static {$packages}"); if (!empty($output[1][0])) { $libs = $output[1][0]; - $envs .= " LIBS=\"{$libs} -lstdc++\" "; + $libcpp = ''; + if ($this->builder->getLib('icu')) { + $libcpp = $this instanceof LinuxLibraryBase ? ' -lstdc++' : ' -lc++'; + } + $envs .= " LIBS=\"{$libs}{$libcpp}\" "; } FileSystem::resetDir($this->source_dir . '/build');