fix linux builder cpp link option

This commit is contained in:
crazywhalecc 2023-08-22 18:16:23 +08:00 committed by Jerry Ma
parent 15905c063a
commit 100d31791a

View File

@ -134,7 +134,7 @@ class LinuxBuilder extends BuilderBase
$extra_libs .= (empty($extra_libs) ? '' : ' ') . implode(' ', array_map(fn ($x) => "-Xcompiler {$x}", array_filter($this->getAllStaticLibFiles())));
}
// add libstdc++, some extensions or libraries need it (C++ cannot be linked statically)
$extra_libs .= (empty($extra_libs) ? '' : ' ') . ($this->hasCppExtension() ? '-lc++ ' : '');
$extra_libs .= (empty($extra_libs) ? '' : ' ') . ($this->hasCppExtension() ? '-lstdc++ ' : '');
$this->setOption('extra-libs', $extra_libs);
$cflags = $this->arch_c_flags;