mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +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.
42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\windows\library;
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
class libaom extends WindowsLibraryBase
|
|
{
|
|
public const NAME = 'libaom';
|
|
|
|
protected function build(): void
|
|
{
|
|
// libaom source tree contains a build/cmake/ directory with its own
|
|
// cmake modules, so we must use a different name for the build dir.
|
|
FileSystem::resetDir($this->source_dir . '\builddir');
|
|
|
|
// start build
|
|
cmd()->cd($this->source_dir)
|
|
->execWithWrapper(
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
'-S . -B builddir ' .
|
|
'-A x64 ' .
|
|
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
|
'-DCMAKE_BUILD_TYPE=Release ' .
|
|
'-DBUILD_SHARED_LIBS=OFF ' .
|
|
'-DAOM_TARGET_CPU=generic ' .
|
|
'-DENABLE_DOCS=OFF ' .
|
|
'-DENABLE_EXAMPLES=OFF ' .
|
|
'-DENABLE_TESTDATA=OFF ' .
|
|
'-DENABLE_TESTS=OFF ' .
|
|
'-DENABLE_TOOLS=OFF ' .
|
|
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
|
)
|
|
->execWithWrapper(
|
|
$this->builder->makeSimpleWrapper('cmake'),
|
|
"--build builddir --config Release --target install -j{$this->builder->concurrency}"
|
|
);
|
|
}
|
|
}
|