mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
cs fix hook isn't working on windows
This commit is contained in:
parent
6ed440d861
commit
53eb6dcc80
@ -343,37 +343,6 @@ class Extension
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get required static and shared libraries as a pair of strings in format -l{libname} -l{libname2}
|
|
||||||
*
|
|
||||||
* @return array [staticLibString, sharedLibString]
|
|
||||||
*/
|
|
||||||
private function getStaticAndSharedLibs(): array
|
|
||||||
{
|
|
||||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], with_dependencies: true);
|
|
||||||
$sharedLibString = '';
|
|
||||||
$staticLibString = '';
|
|
||||||
$staticLibs = $this->getLibFilesString();
|
|
||||||
$staticLibs = str_replace(BUILD_LIB_PATH . '/lib', '-l', $staticLibs);
|
|
||||||
$staticLibs = str_replace('.a', '', $staticLibs);
|
|
||||||
$staticLibs = explode('-l', $staticLibs . ' ' . $config['libs']);
|
|
||||||
foreach ($staticLibs as $lib) {
|
|
||||||
$lib = trim($lib);
|
|
||||||
if ($lib === '') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$static_lib = 'lib' . $lib . '.a';
|
|
||||||
if (file_exists(BUILD_LIB_PATH . '/' . $static_lib)) {
|
|
||||||
if (!str_contains($staticLibString, '-l' . $lib . ' ')) {
|
|
||||||
$staticLibString .= '-l' . $lib . ' ';
|
|
||||||
}
|
|
||||||
} elseif (!str_contains($sharedLibString, '-l' . $lib . ' ')) {
|
|
||||||
$sharedLibString .= '-l' . $lib . ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [$staticLibString, $sharedLibString];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build shared extension for Unix
|
* Build shared extension for Unix
|
||||||
*
|
*
|
||||||
@ -479,6 +448,37 @@ class Extension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get required static and shared libraries as a pair of strings in format -l{libname} -l{libname2}
|
||||||
|
*
|
||||||
|
* @return array [staticLibString, sharedLibString]
|
||||||
|
*/
|
||||||
|
private function getStaticAndSharedLibs(): array
|
||||||
|
{
|
||||||
|
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], with_dependencies: true);
|
||||||
|
$sharedLibString = '';
|
||||||
|
$staticLibString = '';
|
||||||
|
$staticLibs = $this->getLibFilesString();
|
||||||
|
$staticLibs = str_replace(BUILD_LIB_PATH . '/lib', '-l', $staticLibs);
|
||||||
|
$staticLibs = str_replace('.a', '', $staticLibs);
|
||||||
|
$staticLibs = explode('-l', $staticLibs . ' ' . $config['libs']);
|
||||||
|
foreach ($staticLibs as $lib) {
|
||||||
|
$lib = trim($lib);
|
||||||
|
if ($lib === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$static_lib = 'lib' . $lib . '.a';
|
||||||
|
if (file_exists(BUILD_LIB_PATH . '/' . $static_lib)) {
|
||||||
|
if (!str_contains($staticLibString, '-l' . $lib . ' ')) {
|
||||||
|
$staticLibString .= '-l' . $lib . ' ';
|
||||||
|
}
|
||||||
|
} elseif (!str_contains($sharedLibString, '-l' . $lib . ' ')) {
|
||||||
|
$sharedLibString .= '-l' . $lib . ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [$staticLibString, $sharedLibString];
|
||||||
|
}
|
||||||
|
|
||||||
private function getLibraryDependencies(bool $recursive = false): array
|
private function getLibraryDependencies(bool $recursive = false): array
|
||||||
{
|
{
|
||||||
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
|
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user