Skip to content

Commit 313a457

Browse files
author
Hendrik Mennen
committed
Add Windows builder for brotli library
brotli was listed in lib.json with Windows static lib entries but had no Windows library builder, causing Windows builds to fail when brotli is included as a suggested dependency. The builder follows the standard Windows CMake pattern, disabling shared libs and build tools for a minimal static build.
1 parent 4b649f9 commit 313a457

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
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+
}

0 commit comments

Comments
 (0)