mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
add wrong usage exception
This commit is contained in:
@@ -9,6 +9,7 @@ use SPC\builder\linux\library\LinuxLibraryBase;
|
||||
use SPC\builder\traits\UnixBuilderTrait;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\Patcher;
|
||||
|
||||
/**
|
||||
@@ -86,7 +87,7 @@ class LinuxBuilder extends BuilderBase
|
||||
}
|
||||
}
|
||||
if (!empty($missing)) {
|
||||
throw new RuntimeException('missing system commands: ' . implode(', ', $missing));
|
||||
throw new WrongUsageException('missing system commands: ' . implode(', ', $missing));
|
||||
}
|
||||
|
||||
// 创立 pkg-config 和放头文件的目录
|
||||
@@ -151,7 +152,7 @@ class LinuxBuilder extends BuilderBase
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException('libc ' . $this->libc . ' is not implemented yet');
|
||||
throw new WrongUsageException('libc ' . $this->libc . ' is not implemented yet');
|
||||
}
|
||||
|
||||
$envs = "{$envs} CFLAGS='{$cflags}' LIBS='-ldl -lpthread'";
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace SPC\builder\linux;
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
use SPC\builder\traits\UnixSystemUtilTrait;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
|
||||
class SystemUtil
|
||||
{
|
||||
@@ -128,10 +129,10 @@ class SystemUtil
|
||||
'clang' => match ($arch) {
|
||||
'x86_64' => '--target=x86_64-unknown-linux',
|
||||
'arm64', 'aarch64' => '--target=arm64-unknown-linux',
|
||||
default => throw new RuntimeException('unsupported arch: ' . $arch),
|
||||
default => throw new WrongUsageException('unsupported arch: ' . $arch),
|
||||
},
|
||||
'gcc' => '',
|
||||
default => throw new RuntimeException('cc compiler ' . $cc . ' is not supported'),
|
||||
default => throw new WrongUsageException('cc compiler ' . $cc . ' is not supported'),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user