mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 06:45:39 +08:00
Refactor LibraryPackage to skip pkg-config and static-bin checks on Windows
This commit is contained in:
@@ -44,18 +44,20 @@ class LibraryPackage extends Package
|
||||
return false;
|
||||
}
|
||||
}
|
||||
foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $pc) {
|
||||
if (!str_ends_with($pc, '.pc')) {
|
||||
$pc .= '.pc';
|
||||
if (SystemTarget::getTargetOS() !== 'Windows') {
|
||||
foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $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}")) {
|
||||
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;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user