mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Add snappy
This commit is contained in:
parent
6be4da26aa
commit
fd40b92041
20
config/pkg/lib/snappy.yml
Normal file
20
config/pkg/lib/snappy.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
snappy:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: git
|
||||||
|
rev: main
|
||||||
|
url: 'https://github.com/google/snappy'
|
||||||
|
metadata:
|
||||||
|
license-files: [COPYING]
|
||||||
|
license: BSD-3-Clause
|
||||||
|
depends:
|
||||||
|
- zlib
|
||||||
|
headers@unix:
|
||||||
|
- snappy.h
|
||||||
|
- snappy-c.h
|
||||||
|
- snappy-sinksource.h
|
||||||
|
- snappy-stubs-public.h
|
||||||
|
lang: cpp
|
||||||
|
static-libs@unix:
|
||||||
|
- libsnappy.a
|
||||||
27
src/Package/Library/snappy.php
Normal file
27
src/Package/Library/snappy.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
|
||||||
|
|
||||||
|
#[Library('snappy')]
|
||||||
|
class snappy
|
||||||
|
{
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
public function buildUnix(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
UnixCMakeExecutor::create($lib)
|
||||||
|
->setBuildDir("{$lib->getSourceDir()}/cmake/build")
|
||||||
|
->addConfigureArgs(
|
||||||
|
'-DSNAPPY_BUILD_TESTS=OFF',
|
||||||
|
'-DSNAPPY_BUILD_BENCHMARKS=OFF',
|
||||||
|
)
|
||||||
|
->build('../..');
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user