Use existing pkg-config builds and pre-built contents for packages

This commit is contained in:
crazywhalecc
2025-08-31 15:04:34 +08:00
parent f2c131a2cc
commit 0fa38bad6d
14 changed files with 157 additions and 145 deletions

View File

@@ -5,9 +5,7 @@ declare(strict_types=1);
namespace SPC\toolchain;
use SPC\builder\linux\SystemUtil;
use SPC\exception\EnvironmentException;
use SPC\exception\WrongUsageException;
use SPC\store\pkg\PkgConfig;
use SPC\util\GlobalEnvManager;
use SPC\util\SPCTarget;
@@ -58,10 +56,6 @@ class ToolchainManager
if (SPCTarget::getLibc() === 'glibc' && SystemUtil::isMuslDist()) {
throw new WrongUsageException('You are linking against glibc dynamically, which is only supported on glibc distros.');
}
if (!is_dir(PkgConfig::getEnvironment()['PATH'])) {
throw new EnvironmentException('Please install pkg-config first. (You can use `doctor` command to install it)');
}
GlobalEnvManager::addPathIfNotExists(PkgConfig::getEnvironment()['PATH']);
$toolchain = getenv('SPC_TOOLCHAIN');
/* @var ToolchainInterface $toolchain */
$instance = new $toolchain();