mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
28 lines
760 B
PHP
28 lines
760 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
use SPC\toolchain\ToolchainManager;
|
|
use SPC\toolchain\ZigToolchain;
|
|
use SPC\util\executor\UnixCMakeExecutor;
|
|
|
|
trait libaom
|
|
{
|
|
protected function build(): void
|
|
{
|
|
$extra = getenv('SPC_COMPILER_EXTRA');
|
|
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
|
$new = trim($extra . ' -D_GNU_SOURCE');
|
|
f_putenv("SPC_COMPILER_EXTRA={$new}");
|
|
}
|
|
UnixCMakeExecutor::create($this)
|
|
->setBuildDir("{$this->source_dir}/builddir")
|
|
->addConfigureArgs('-DAOM_TARGET_CPU=generic')
|
|
->build();
|
|
f_putenv("SPC_COMPILER_EXTRA={$extra}");
|
|
$this->patchPkgconfPrefix(['aom.pc']);
|
|
}
|
|
}
|