Move zig-toolchain-only things to zig toolchain class

This commit is contained in:
crazywhalecc
2025-07-22 13:16:26 +08:00
parent 3350888af6
commit f69f8d1e4a
5 changed files with 34 additions and 51 deletions

View File

@@ -11,8 +11,6 @@ use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\toolchain\ToolchainManager;
use SPC\toolchain\ZigToolchain;
use Symfony\Component\Console\Input\ArgvInput;
class SPCConfigUtil
@@ -71,9 +69,7 @@ class SPCConfigUtil
if ($this->builder->hasCpp()) {
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
}
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
$libs .= ' -lunwind';
}
$libs .= ' ' . (getenv('SPC_EXTRA_LIBS') ?: '');
// mimalloc must come first
if (str_contains($libs, BUILD_LIB_PATH . '/mimalloc.o')) {
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);