mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 22:35:43 +08:00
35 lines
871 B
PHP
35 lines
871 B
PHP
<?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;
|
|
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
|
|
|
#[Library('libuv')]
|
|
class libuv
|
|
{
|
|
#[BuildFor('Darwin')]
|
|
#[BuildFor('Linux')]
|
|
public function buildUnix(LibraryPackage $lib): void
|
|
{
|
|
UnixCMakeExecutor::create($lib)
|
|
->addConfigureArgs('-DLIBUV_BUILD_SHARED=OFF')
|
|
->build();
|
|
// patch pkgconfig
|
|
$lib->patchPkgconfPrefix(['libuv-static.pc']);
|
|
}
|
|
|
|
#[BuildFor('Windows')]
|
|
public function buildWindows(LibraryPackage $lib): void
|
|
{
|
|
WindowsCMakeExecutor::create($lib)
|
|
->addConfigureArgs('-DLIBUV_BUILD_SHARED=OFF')
|
|
->build();
|
|
}
|
|
}
|