Add homebrew llvm version toolchain support

This commit is contained in:
crazywhalecc
2026-03-20 11:20:42 +08:00
parent 00649d816e
commit e9be3a41db
4 changed files with 42 additions and 1 deletions

View File

@@ -39,7 +39,10 @@ class ToolchainManager
return match (PHP_OS_FAMILY) {
'Linux' => ZigToolchain::class,
'Windows' => MSVCToolchain::class,
'Darwin' => ClangNativeToolchain::class,
'Darwin' => match (getenv('SPC_USE_LLVM') ?: 'system') {
'brew' => ClangBrewToolchain::class,
default => ClangNativeToolchain::class,
},
default => throw new WrongUsageException('Unsupported OS family: ' . PHP_OS_FAMILY),
};
}