mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-14 20:35:35 +08:00
refactor: move getLibExtra* to Package base, add ToolPackage support to executors and builders
- Move getLibExtraCFlags/getLibExtraCxxFlags/getLibExtraLdFlags/getLibExtraLibs from LibraryPackage to Package base class so ToolPackage can also use them - Full ToolPackage implementation: getBuildRootPath, getIncludeDir, getLibDir, getBinDir, getToolField with platform suffix support - Update PackageBuilder to support building ToolPackage (not just LibraryPackage) - Update PackageInstaller: support ToolPackage in download/extract/install pipeline, auto-install build-time tools, record installed versions - Allow LibraryPackage|ToolPackage union type in all Executor classes and UnixShell::initializeEnv
This commit is contained in:
@@ -6,6 +6,7 @@ namespace StaticPHP\Runtime\Shell;
|
||||
|
||||
use StaticPHP\Exception\SPCInternalException;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Package\ToolPackage;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
use ZM\Logger\ConsoleColor;
|
||||
|
||||
@@ -40,9 +41,9 @@ class UnixShell extends Shell
|
||||
/**
|
||||
* Init the environment variable that common build will be used.
|
||||
*
|
||||
* @param LibraryPackage $library Library package
|
||||
* @param LibraryPackage|ToolPackage $library Library or tool package
|
||||
*/
|
||||
public function initializeEnv(LibraryPackage $library): UnixShell
|
||||
public function initializeEnv(LibraryPackage|ToolPackage $library): UnixShell
|
||||
{
|
||||
$this->setEnv([
|
||||
'CFLAGS' => $library->getLibExtraCFlags(),
|
||||
|
||||
Reference in New Issue
Block a user