mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 21:34:53 +08:00
reduce libphp.a size by stripping .a archives inside it as well
This commit is contained in:
parent
2cb1a95132
commit
6e74dabc1c
@ -323,6 +323,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
|
||||
f_passthru('ar -t ' . BUILD_LIB_PATH . "/libphp.a | grep '\\.a$' | xargs -n1 ar d " . BUILD_LIB_PATH . '/libphp.a');
|
||||
}
|
||||
|
||||
if (!$this->getOption('no-strip', false) && file_exists(BUILD_LIB_PATH . '/' . $realLibName)) {
|
||||
shell()->cd(BUILD_LIB_PATH)->exec("strip --strip-unneeded {$realLibName}");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user