30 lines
748 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
2025-06-09 09:24:31 +08:00
use SPC\util\executor\UnixCMakeExecutor;
trait libaom
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
if (getenv('SPC_LIBC') === 'musl' && str_contains(getenv('CC'), 'zig')) {
f_putenv('COMPILER_EXTRA=-D_POSIX_SOURCE');
2025-06-27 20:28:59 +07:00
}
UnixCMakeExecutor::create($this)
2025-06-09 09:26:39 +08:00
->setBuildDir("{$this->source_dir}/builddir")
2025-06-09 12:49:33 +08:00
->addConfigureArgs('-DAOM_TARGET_CPU=generic')
->build();
f_putenv('COMPILER_EXTRA');
$this->patchPkgconfPrefix(['aom.pc']);
}
}