zig toolchain stuff

This commit is contained in:
DubbleClick
2025-07-01 14:01:48 +07:00
parent 5370af4a84
commit 0a33fba23e
10 changed files with 149 additions and 38 deletions

View File

@@ -10,6 +10,8 @@ use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
use SPC\store\SourcePatcher;
use SPC\toolchain\ToolchainManager;
use SPC\toolchain\ZigToolchain;
use SPC\util\GlobalEnvManager;
class LinuxBuilder extends UnixBuilderBase
@@ -66,7 +68,7 @@ class LinuxBuilder extends UnixBuilderBase
}
// add libstdc++, some extensions or libraries need it
$extra_libs .= (empty($extra_libs) ? '' : ' ') . ($this->hasCpp() ? '-lstdc++ ' : '');
$extra_libs .= (SystemUtil::getCCType() === 'clang' ? ' -lunwind' : '');
$extra_libs .= (ToolchainManager::getToolchainClass() === ZigToolchain::class ? ' -lunwind' : '');
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
$cflags = $this->arch_c_flags;
f_putenv('CFLAGS=' . $cflags);