Skip to content

Commit 4b649f9

Browse files
author
Hendrik Mennen
committed
Add Windows builder for libaom library
libaom was listed in lib.json and used as a dependency of libavif, but had no Windows library builder, causing all Windows builds to fail with: "library [libaom] is in the lib.json list but not supported to compile" This adds the missing Windows CMake builder following the same pattern as other Windows library builders (libavif, libwebp, freetype). The builder disables docs, examples, tests, and tools for a minimal static build and uses AOM_TARGET_CPU=generic for portability, matching the Unix builder. Also adds the static-libs-windows entry to lib.json so the build system can locate the produced aom.lib artifact.
1 parent 4ed6d22 commit 4b649f9

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
// 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+
'-DAOM_TARGET_CPU=generic ' .
28+
'-DENABLE_DOCS=OFF ' .
29+
'-DENABLE_EXAMPLES=OFF ' .
30+
'-DENABLE_TESTDATA=OFF ' .
31+
'-DENABLE_TESTS=OFF ' .
32+
'-DENABLE_TOOLS=OFF ' .
33+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
34+
)
35+
->execWithWrapper(
36+
$this->builder->makeSimpleWrapper('cmake'),
37+
"--build build --config Release --target install -j{$this->builder->concurrency}"
38+
);
39+
}
40+
}

0 commit comments

Comments
 (0)