mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
Add lz4 and ext-lz4 for Windows
This commit is contained in:
@@ -2,8 +2,9 @@ ext-lz4:
|
||||
type: php-extension
|
||||
artifact:
|
||||
source:
|
||||
type: ghtagtar
|
||||
repo: kjdev/php-ext-lz4
|
||||
type: git
|
||||
url: 'https://github.com/kjdev/php-ext-lz4.git'
|
||||
rev: master
|
||||
extract: php-src/ext/lz4
|
||||
metadata:
|
||||
license-files: [LICENSE]
|
||||
|
||||
@@ -11,3 +11,5 @@ liblz4:
|
||||
license: BSD-2-Clause
|
||||
static-libs@unix:
|
||||
- liblz4.a
|
||||
static-libs@windows:
|
||||
- lz4.lib
|
||||
|
||||
@@ -10,6 +10,7 @@ use StaticPHP\Attribute\Package\PatchBeforeBuild;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Package\PackageBuilder;
|
||||
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Library('liblz4')]
|
||||
@@ -22,6 +23,16 @@ class liblz4
|
||||
FileSystem::replaceFileStr($lib->getSourceDir() . '/programs/Makefile', 'install: lz4', "install: lz4\n\ninstallewfwef: lz4");
|
||||
}
|
||||
|
||||
#[BuildFor('Windows')]
|
||||
public function buildWin(LibraryPackage $lib): void
|
||||
{
|
||||
WindowsCMakeExecutor::create($lib)
|
||||
->setWorkingDir("{$lib->getSourceDir()}/build/cmake")
|
||||
->setBuildDir("{$lib->getSourceDir()}/_win_build")
|
||||
->addConfigureArgs('-DLZ4_BUILD_CLI=OFF')
|
||||
->build();
|
||||
}
|
||||
|
||||
#[BuildFor('Darwin')]
|
||||
#[BuildFor('Linux')]
|
||||
public function buildUnix(LibraryPackage $lib, PackageBuilder $builder): void
|
||||
|
||||
Reference in New Issue
Block a user