mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
Both libraries are listed in lib.json and used as transitive dependencies (libaom via libavif, brotli via freetype/curl) but had no Windows builder, causing builds to fail with "library [X] is in the lib.json list but not supported to compile". libaom: Uses builddir instead of build to avoid collision with the source tree's build/cmake/ directory. Matches the Unix builder's AOM_TARGET_CPU=generic setting for portability. brotli: Standard CMake build with shared libs and tools disabled. Also adds static-libs-windows entry for libaom in lib.json.
37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\windows\library;
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
class brotli extends WindowsLibraryBase
|
|
{
|
|
public const NAME = 'brotli';
|
|
|
|
protected function build(): void
|
|
{
|
|
// reset cmake
|
|
FileSystem::resetDir($this->source_dir . '\build');
|
|
|
|
// start build
|
|
cmd()->cd($this->source_dir)
|
|
->execWithWrapper(
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
'-B build ' .
|
|
'-A x64 ' .
|
|
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
|
'-DCMAKE_BUILD_TYPE=Release ' .
|
|
'-DBUILD_SHARED_LIBS=OFF ' .
|
|
'-DBROTLI_BUILD_TOOLS=OFF ' .
|
|
'-DBROTLI_BUNDLED_MODE=OFF ' .
|
|
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
|
)
|
|
->execWithWrapper(
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
|
);
|
|
}
|
|
}
|