mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
needed --libs --static
This commit is contained in:
@@ -62,9 +62,13 @@ class grpc extends Extension
|
||||
|
||||
private function getLibraries(): array
|
||||
{
|
||||
[, $out] = shell()->execWithResult('$PKG_CONFIG --libs-only-l grpc');
|
||||
[, $out] = shell()->execWithResult('$PKG_CONFIG --libs --static grpc');
|
||||
$libs = join(' ', $out) . ' -lupb -lupb_message_lib -lupb_json_lib -lupb_textformat_lib -lupb_mini_descriptor_lib -lupb_wire_lib -lupb_mem_lib -lupb_base_lib -lutf8_range';
|
||||
$libs = str_replace('-l', '', $libs);
|
||||
return explode(' ', $libs);
|
||||
$filtered = str_replace('-pthread', '', $libs);
|
||||
$filtered = preg_replace('/-L\S+/', '', $filtered);
|
||||
$filtered = preg_replace('/(?:\S*\/)?lib([a-zA-Z0-9_+-]+)\.a\b/', '-l$1', $filtered);
|
||||
$out = str_replace('-l', '', $filtered);
|
||||
$out = preg_replace('/\s+/', ' ', $out);
|
||||
return explode(' ', trim($out));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user