Files
static-php-cli/src/SPC/builder/unix/library/libwebp.php

34 lines
1.1 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
2025-06-09 09:24:31 +08:00
use SPC\util\executor\UnixCMakeExecutor;
2025-12-01 19:55:51 +01:00
use SPC\util\SPCTarget;
trait libwebp
{
protected function build(): void
{
UnixCMakeExecutor::create($this)
2025-12-01 16:55:52 +01:00
->addConfigureArgs(
2025-12-01 19:55:51 +01:00
'-DWEBP_BUILD_EXTRAS=OFF',
'-DWEBP_BUILD_ANIM_UTILS=OFF',
'-DWEBP_BUILD_CWEBP=OFF',
'-DWEBP_BUILD_DWEBP=OFF',
'-DWEBP_BUILD_GIF2WEBP=OFF',
'-DWEBP_BUILD_IMG2WEBP=OFF',
'-DWEBP_BUILD_VWEBP=OFF',
'-DWEBP_BUILD_WEBPINFO=OFF',
'-DWEBP_BUILD_WEBPMUX=OFF',
'-DWEBP_BUILD_FUZZTEST=OFF',
SPCTarget::getLibcVersion() === '2.31' && GNU_ARCH === 'x86_64' ? '-DWEBP_ENABLE_SIMD=OFF' : '' // fix an edge bug for debian 11 with gcc 10
2025-12-01 16:55:52 +01:00
)
->build();
2023-08-27 03:05:53 +08:00
// patch pkgconfig
2025-07-22 22:09:45 +08:00
$this->patchPkgconfPrefix(patch_option: PKGCONF_PATCH_PREFIX | PKGCONF_PATCH_LIBDIR);
$this->patchPkgconfPrefix(['libsharpyuv.pc'], PKGCONF_PATCH_CUSTOM, ['/^includedir=.*$/m', 'includedir=${prefix}/include/webp']);
}
}