Refactor LibraryPackage to skip pkg-config and static-bin checks on Windows

This commit is contained in:
crazywhalecc
2026-03-21 00:32:02 +08:00
parent 7df861696d
commit f6e00c67cc

View File

@@ -44,18 +44,20 @@ class LibraryPackage extends Package
return false; return false;
} }
} }
foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $pc) { if (SystemTarget::getTargetOS() !== 'Windows') {
if (!str_ends_with($pc, '.pc')) { foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $pc) {
$pc .= '.pc'; if (!str_ends_with($pc, '.pc')) {
$pc .= '.pc';
}
if (!file_exists("{$this->getLibDir()}/pkgconfig/{$pc}")) {
return false;
}
} }
if (!file_exists("{$this->getLibDir()}/pkgconfig/{$pc}")) { foreach (PackageConfig::get($this->getName(), 'static-bins', []) as $bin) {
return false; $path = FileSystem::isRelativePath($bin) ? "{$this->getBinDir()}/{$bin}" : $bin;
} if (!file_exists($path)) {
} return false;
foreach (PackageConfig::get($this->getName(), 'static-bins', []) as $bin) { }
$path = FileSystem::isRelativePath($bin) ? "{$this->getBinDir()}/{$bin}" : $bin;
if (!file_exists($path)) {
return false;
} }
} }
return true; return true;