Skip to content

Commit 963e2a0

Browse files
author
Hendrik Mennen
committed
Add Windows builders for libaom and brotli libraries
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.
1 parent 4c6b7a3 commit 963e2a0

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

config/lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@
355355
"static-libs-unix": [
356356
"libaom.a"
357357
],
358+
"static-libs-windows": [
359+
"aom.lib"
360+
],
358361
"cpp-library": true
359362
},
360363
"libargon2": {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\windows\library;
6+
7+
use SPC\store\FileSystem;
8+
9+
class brotli extends WindowsLibraryBase
10+
{
11+
public const NAME = 'brotli';
12+
13+
protected function build(): void
14+
{
15+
// reset cmake
16+
FileSystem::resetDir($this->source_dir . '\build');
17+
18+
// start build
19+
cmd()->cd($this->source_dir)
20+
->execWithWrapper(
21+
$this->builder->makeSimpleWrapper('cmake'),
22+
'-B build ' .
23+
'-A x64 ' .
24+
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
25+
'-DCMAKE_BUILD_TYPE=Release ' .
26+
'-DBUILD_SHARED_LIBS=OFF ' .
27+
'-DBROTLI_BUILD_TOOLS=OFF ' .
28+
'-DBROTLI_BUNDLED_MODE=OFF ' .
29+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
30+
)
31+
->execWithWrapper(
32+
$this->builder->makeSimpleWrapper('cmake'),
33+
"--build build --config Release --target install -j{$this->builder->concurrency}"
34+
);
35+
}
36+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\windows\library;
6+
7+
use SPC\store\FileSystem;
8+
9+
class libaom extends WindowsLibraryBase
10+
{
11+
public const NAME = 'libaom';
12+
13+
protected function build(): void
14+
{
15+
// libaom source tree contains a build/cmake/ directory with its own
16+
// cmake modules, so we must use a different name for the build dir.
17+
FileSystem::resetDir($this->source_dir . '\builddir');
18+
19+
// start build
20+
cmd()->cd($this->source_dir)
21+
->execWithWrapper(
22+
$this->builder->makeSimpleWrapper('cmake'),
23+
'-S . -B builddir ' .
24+
'-A x64 ' .
25+
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
26+
'-DCMAKE_BUILD_TYPE=Release ' .
27+
'-DBUILD_SHARED_LIBS=OFF ' .
28+
'-DAOM_TARGET_CPU=generic ' .
29+
'-DENABLE_DOCS=OFF ' .
30+
'-DENABLE_EXAMPLES=OFF ' .
31+
'-DENABLE_TESTDATA=OFF ' .
32+
'-DENABLE_TESTS=OFF ' .
33+
'-DENABLE_TOOLS=OFF ' .
34+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
35+
)
36+
->execWithWrapper(
37+
$this->builder->makeSimpleWrapper('cmake'),
38+
"--build builddir --config Release --target install -j{$this->builder->concurrency}"
39+
);
40+
}
41+
}

0 commit comments

Comments
 (0)